|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnenok.Knowledgebase
nenok.net.registry.RemoteKB
public class RemoteKB
A knowledgebase is basically a set of Locator
objects. Because each locator identifies unambigously a valuation
object stored on a Nenok processor, this represents indeed the mathematical idea of a distributed knowledgebase.
Knowledgebases contain only elements of the same type. However, because Locator
objects are only pointer on the
storage place (processor) of a valuation, this type checking cannot be done at compile-time. So, the first added element
determines which type this knowledgebase accepts. If this constraint is not satisfied, an IllegalArgumentException
is thrown.
Constructor Summary | |
---|---|
|
RemoteKB(Locator[] locators,
String name)
Constructor: |
protected |
RemoteKB(String name)
Constructor: |
Method Summary | |
---|---|
boolean |
add(Locator loc)
Adds a new locator to this knowledgebase. |
boolean |
addAll(Collection<Locator> locators)
Adds a new collection of locators to this knowledgebase. |
boolean |
addAll(Locator[] locators)
Adds a new array of locators to this knowledgebase. |
boolean |
contains(Locator loc)
Looks for a given locator within this knowledgebase. |
Domain |
getDomain()
|
Predictor |
getPredictor()
|
Class |
getType()
Loads dynamically the class type of the valuations referenced by this knowledgebase. |
Valuation[] |
getValuations()
|
Iterator<Locator> |
iterator()
|
boolean |
remove(Locator loc)
Removes a given locator from this knowledgebase. |
int |
size()
|
Locator[] |
toArray()
|
Methods inherited from class nenok.Knowledgebase |
---|
create, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RemoteKB(String name)
name
- The knowledgebase's name.public RemoteKB(Locator[] locators, String name)
name
- The knowledgebase's name.locators
- The locators to add to the new knowledgebase.Method Detail |
---|
public boolean add(Locator loc)
loc
- The locator to add.
true
, it the locator has been added successfully.public boolean addAll(Collection<Locator> locators)
locators
- The locators to add.
true
, it all locators have been added successfully.public boolean addAll(Locator[] locators)
locators
- The locators to add.
true
, it all locators have been added successfully.public boolean remove(Locator loc)
loc
- The locator to remove.
true
, if the locator has been removed successfully.public boolean contains(Locator loc)
loc
- The locator to search.
true
, if the locator has been found.public int size()
size
in class Knowledgebase
Knowledgebase.size()
public Locator[] toArray()
toArray
in class Knowledgebase
Knowledgebase.toArray()
public Valuation[] getValuations() throws RemoteException
getValuations
in class Knowledgebase
RemoteException
- Exception caused by communication problems if valuations
are read from a remote processor.Knowledgebase.getValuations()
public Predictor getPredictor() throws RemoteException
RemoteException
- This operation performs remote calls and therefore forewards RemoteExceptions.public Iterator<Locator> iterator()
iterator
in interface Iterable<Locator>
Iterable.iterator()
public Domain getDomain()
getDomain
in class Knowledgebase
Knowledgebase.getDomain()
public Class getType() throws RemoteException
null
, if this knowledgebase is empty.
getType
in class Knowledgebase
RemoteException
Knowledgebase.getType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |