jcreek.representation
Class RelationTypeSet

java.lang.Object
  extended byjcreek.representation.RelationTypeSet
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class RelationTypeSet
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class represents a set of RelationTypes.

See Also:
Serialized Form

Constructor Summary
RelationTypeSet()
          Create an empty RelationTypeSet.
RelationTypeSet(RelationType rcd)
          Creates a RelationTypeSet from the supplied RelationType.
 
Method Summary
 void addElement(RelationType rcd)
          Adds the supplied RelationType to the set, but does not add subclasses of the RelationType.
protected  java.lang.Object clone()
           
 boolean contains(RelationType rcd)
          Returnes true if the set contains the supplied RelationType.
 RelationTypeSet copy()
           
 boolean empty()
          Returnes true if the set is empty.
 boolean equals(java.lang.Object ob)
           
 int hashCode()
           
 RelationTypeSet intersect(RelationTypeSet newRule)
          Merges this RelationTypeSet with another RelationTypeSet in such a manner that it will only contain the RelationTypes contained in both sets.
 boolean isSubsetOf(RelationTypeSet rule)
          Returnes true if this set is a subset of the supplied set.
 void removeElement(RelationType rcd)
          Removes the supplied RelationType to the set, but does not add subclasses of the RelationType.
 RelationTypeSet subtract(RelationTypeSet newRule)
          Removes all RelationTypes found in set passed as a parameter to the method.
 java.lang.String toString()
           
 RelationTypeSet union(RelationTypeSet newRule)
          Merges this RelationTypeSet with another RelationTypeSet in such a manner that it will contain all the RelationTypes contained in either set.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationTypeSet

public RelationTypeSet()
Create an empty RelationTypeSet.


RelationTypeSet

public RelationTypeSet(RelationType rcd)
Creates a RelationTypeSet from the supplied RelationType. All direct and indirect subclasses of the relation type represented by the RelationType is included in the set.

Method Detail

intersect

public RelationTypeSet intersect(RelationTypeSet newRule)
Merges this RelationTypeSet with another RelationTypeSet in such a manner that it will only contain the RelationTypes contained in both sets. Only the RelationTypeSet in which the method is called is modified. The returned RelationTypeSet is actually a reference to the set in which the method is invoked.


union

public RelationTypeSet union(RelationTypeSet newRule)
Merges this RelationTypeSet with another RelationTypeSet in such a manner that it will contain all the RelationTypes contained in either set. Only the RelationTypeSet in which the method is called is modified. The returned RelationTypeSet is actually a reference to the set in which the method is invoked.


subtract

public RelationTypeSet subtract(RelationTypeSet newRule)
Removes all RelationTypes found in set passed as a parameter to the method. The returned set is guaranteed to have no RelationTypes in common with the set passed to the method as a parameter. Only the RelationTypeSet in which the method is called is modified. The returned RelationTypeSet is actually a reference to the set in which the method is invoked.


isSubsetOf

public boolean isSubsetOf(RelationTypeSet rule)
Returnes true if this set is a subset of the supplied set.


addElement

public void addElement(RelationType rcd)
Adds the supplied RelationType to the set, but does not add subclasses of the RelationType.


removeElement

public void removeElement(RelationType rcd)
Removes the supplied RelationType to the set, but does not add subclasses of the RelationType.


contains

public boolean contains(RelationType rcd)
Returnes true if the set contains the supplied RelationType.


empty

public boolean empty()
Returnes true if the set is empty.


clone

protected java.lang.Object clone()

copy

public RelationTypeSet copy()

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object ob)

hashCode

public int hashCode()


Created at IDI, NTNU by the Artificial Intelligence and Learning group