nenok
Class Knowledgebase<T extends Labeled>
java.lang.Object
nenok.Knowledgebase<T>
- Type Parameters:
T
- Type to distinguish between remote and local knowledgebases.
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- LocalKB, RemoteKB
public abstract class Knowledgebase<T extends Labeled>
- extends Object
- implements Serializable
Knowledgebases allow to collect valuations under an identifies
that is referred to as the knowledgebase's name. Subclasses refine
this type to knowledgebases with either local or remote data.
Note also that knowledgebases are immutable and serializable.
- Version:
- $LastChangedRevision: 550 $
$LastChangedDate: 2008-03-26 14:14:27 +0100 (Mi, 26 Mrz 2008) $
- Author:
- Marc Pouly
- See Also:
- Serialized Form
Knowledgebase
protected Knowledgebase(String name)
- Constructor:
- Parameters:
name
- The identifier of this knowledgebase.
create
public static Knowledgebase create(Valuation[] vals,
String name)
- Factory method:
Creates a knowledgebase from valuations that are local.
- Parameters:
vals
- An array of valuation objects that belong to this knowledgebase.name
- The identifier of this knowledgebase.
- Returns:
- A knowledgebase with the given name and content.
getValuations
public abstract Valuation[] getValuations()
throws RemoteException
- Returns:
- The set of valuations that belong to this knowledgebase.
- Throws:
RemoteException
- Exception caused by communication problems if valuations
are read from a remote processor.
toArray
public abstract T[] toArray()
- Returns:
- The content of this knowledgebase as an array of transmissibles.
getDomain
public abstract Domain getDomain()
- Returns:
- The total domain of this knowledgebase.
getType
public abstract Class getType()
throws Exception
- Returns:
- The type of valuations that is contained in this knowledgebase.
- Throws:
Exception
- Wrapper exception.
size
public abstract int size()
- Returns:
- The size of this knowledgebase.
toString
public String toString()
- Overrides:
toString
in class Object
- See Also:
Object.toString()