jeops
Class ObjectBase

java.lang.Object
  |
  +--jeops.ObjectBase

public class ObjectBase
extends java.lang.Object

This class models the facts over which the inference engine will act. By facts we mean any object that is stored in this base - there's no notion of truth or falseness. A fact simply exists or doesn't.

Version:
0.03 18 Sep 2000 Implementation of the methods transferred from class ObjectHashTable to this class.
Author:
Carlos Figueira Filho (csff@cin.ufpe.br)

Field Summary
private  java.util.Map objects
          The class/objects mapping.
private  java.util.Map subClasses
          The superclasses/subclasses mapping.
 
Constructor Summary
ObjectBase()
          Class constructor.
 
Method Summary
 boolean assert(java.lang.Object obj)
          Inserts a new object into this object base.
 void flush()
          Removes all objects of this base.
private  void insertImplementedInterfaces(java.lang.Class interfaceClass, java.lang.String className)
          Inserts a pairs into the subClass map for the given class, as well as the corresponding pairs for the superinterfaces of the given one.
private  void insertInheritancePair(java.lang.String superclass, java.lang.String subclass)
          Inserts a new pair .
 java.util.Vector objects(java.lang.String className)
          Returns the objects of the given class.
 boolean remove(java.lang.Object obj)
          Removes an object from this object base.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

subClasses

private java.util.Map subClasses
The superclasses/subclasses mapping. Its elements will be Vectors, as there can be more than one subclass per class. Actually, this word is a little misused, as we consider interfaces implemented by a class as its superclasses too.

objects

private java.util.Map objects
The class/objects mapping. Its elements will be Vectors, as there can be more than one element per class.
Constructor Detail

ObjectBase

public ObjectBase()
Class constructor. Creates a new object base, initially empty.
Method Detail

assert

public boolean assert(java.lang.Object obj)
Inserts a new object into this object base.
Parameters:
obj - the object to be inserted.
Returns:
true if the insertion was successful (i.e., the object wasn't in the base; false otherwise.

insertImplementedInterfaces

private void insertImplementedInterfaces(java.lang.Class interfaceClass,
                                         java.lang.String className)
Inserts a pairs into the subClass map for the given class, as well as the corresponding pairs for the superinterfaces of the given one.
Parameters:
interfaceClass - the class object representing the interface.
className - the name of the implementing class.

insertInheritancePair

private void insertInheritancePair(java.lang.String superclass,
                                   java.lang.String subclass)
Inserts a new pair .
Parameters:
superclass - the name of the superclass.
subclass - the name of the subclass.

flush

public void flush()
Removes all objects of this base.

objects

public java.util.Vector objects(java.lang.String className)
Returns the objects of the given class.
Parameters:
className - the name of the class whose objects are being removed from this base.
Returns:
all objects that are instances of the given class.

remove

public boolean remove(java.lang.Object obj)
Removes an object from this object base.
Parameters:
obj - the object to be removed from this base.
Returns:
true if the remotion was successful (i.e., the given object belonged to this base); false otherwise.