JTP API Documentation

jtp.frame.vc
Class ValueCollection

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--jtp.frame.vc.ValueCollection
All Implemented Interfaces:
Collection, Serializable
Direct Known Subclasses:
SlotValueCollection

public abstract class ValueCollection
extends AbstractCollection
implements Serializable

ValueCollection.java Created: Mon Mar 15 02:52:57 1999

See Also:
Serialized Form

Field Summary
protected  Map valueMap
          The set of direct values in this collection, that is, those not included from another VC
 
Constructor Summary
ValueCollection()
          creates a new empty Value Collection, with a 10-element HashSet for directValues.
 
Method Summary
 boolean add(Object o)
          adds a value to directValues
 boolean add(Object o, ReasoningStep proof)
           
 void addValueCollectionListener(ValueCollectionListener vcl)
           
 boolean contains(Object o)
          tests if the supplied parameter is present as either direct or included value in this collection.
 Set directValues()
          an accessor function to the directValues instance variable.
 Collection getInputLinks()
          returns the collection of objects of type ValueLink that represent included collections.
 Object getMembershipGoal(Object value)
           
 String getMembershipString(Object o)
           
abstract  Collection getOutputLinks()
           
 ReasoningStep getProof(Object o)
           
 ValueCollectionListener getVCListener()
           
 boolean isEmpty()
          tests the Value Collection for being empty.
 Iterator iterator()
          Returns the iterator over all values in this collection, both direct and included
 boolean remove(Object o)
          removes a value from valueMap
 void removeValueCollectionListener(ValueCollectionListener vcl)
           
 void setInputLinks(Collection c)
           
abstract  void setOutputLinks(Collection c)
           
 void setProof(Object o, ReasoningStep proof)
           
 int size()
          Calculates the size of this VC by adding the size of directValues to the sizes of all included collections (collections included more than once are only counted once.)
 String toString()
          creates a string representation of this value collection; values are listed.
 boolean valueIsInferred(Object o)
           
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

valueMap

protected Map valueMap
The set of direct values in this collection, that is, those not included from another VC

Constructor Detail

ValueCollection

public ValueCollection()
creates a new empty Value Collection, with a 10-element HashSet for directValues.

Method Detail

toString

public String toString()
creates a string representation of this value collection; values are listed.

Overrides:
toString in class AbstractCollection

add

public boolean add(Object o)
adds a value to directValues

Specified by:
add in interface Collection
Overrides:
add in class AbstractCollection

add

public boolean add(Object o,
                   ReasoningStep proof)

setProof

public void setProof(Object o,
                     ReasoningStep proof)

remove

public boolean remove(Object o)
removes a value from valueMap

Specified by:
remove in interface Collection
Overrides:
remove in class AbstractCollection

size

public int size()
Calculates the size of this VC by adding the size of directValues to the sizes of all included collections (collections included more than once are only counted once.)

Specified by:
size in interface Collection
Specified by:
size in class AbstractCollection

iterator

public Iterator iterator()
Returns the iterator over all values in this collection, both direct and included

Specified by:
iterator in interface Collection
Specified by:
iterator in class AbstractCollection

isEmpty

public boolean isEmpty()
tests the Value Collection for being empty.

Specified by:
isEmpty in interface Collection
Overrides:
isEmpty in class AbstractCollection
Returns:
true if directValues is empty, and all included VCs are empty.

contains

public boolean contains(Object o)
tests if the supplied parameter is present as either direct or included value in this collection.

Specified by:
contains in interface Collection
Overrides:
contains in class AbstractCollection
Parameters:
o - a value to look for
Returns:
true if the object is there

directValues

public Set directValues()
an accessor function to the directValues instance variable.

Returns:
directValues

getInputLinks

public Collection getInputLinks()
returns the collection of objects of type ValueLink that represent included collections. Should be overridden by value collections that include others.

Returns:
this base version returns Collections.EMPTY_SET

setInputLinks

public void setInputLinks(Collection c)

getOutputLinks

public abstract Collection getOutputLinks()

setOutputLinks

public abstract void setOutputLinks(Collection c)

getProof

public ReasoningStep getProof(Object o)

valueIsInferred

public boolean valueIsInferred(Object o)

getMembershipString

public String getMembershipString(Object o)

getMembershipGoal

public Object getMembershipGoal(Object value)

getVCListener

public ValueCollectionListener getVCListener()

addValueCollectionListener

public void addValueCollectionListener(ValueCollectionListener vcl)

removeValueCollectionListener

public void removeValueCollectionListener(ValueCollectionListener vcl)

JTP API Documentation