

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +MathSet
This class implements a set of strings. Besides adding and removing elements, this class also provides set operations such as union, setdifference, and intersection.
Constructor Summary  
MathSet()
Constructs an empty set. 

MathSet(String s)
Constructs a set containing the specified string. 

MathSet(String name,
MathSet supset)
Constructs a set whose elements belong to the given set and begin with the given string followed by a parentesis. 

MathSet(Vector v)
Wraps a MathSet around an existing Vector instance. 
Method Summary  
void 
add(String s)
Adds an element to the set. 
MathSet 
diff(MathSet b)
Returns the set difference between the current set and another MathSet. 
MathSet 
diff(Vector b)
Returns the set difference between the current set and a Vector. 
String 
get(int i)
Returns the ith element of the set. 
MathSet 
intersect(MathSet b)
Returns the intersection between the current set and another MathSet. 
MathSet 
intersect(Vector b)
Returns the intersection between the current set and a Vector. 
void 
list()
Writes the contents of the set to System.out, putting one element per line and prefixing the element with its index. 
boolean 
remove(String s)
Removes one element from the set 
int 
size()
Returns the number of elements in the set. 
String 
toString()
Returns a string representing the set. 
Vector 
toVector()
Returns a Vector containing the elements of this set. 
MathSet 
union(MathSet b)
Returns the union between the current set and another MathSet. 
MathSet 
union(Vector b)
Returns the union between the current set and a Vector. 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Constructor Detail 
public MathSet()
public MathSet(String s)
s
 the string to be added to the setpublic MathSet(Vector v)
v
 the vector that will be access through the MathSetpublic MathSet(String name, MathSet supset)
This constructor is useful to build the set of ground instances
of a given fluent, e.g.
MathSet x = new MathSet("position",Set_of_All_Fluents);will construct a set x containing all the ground instances of fluent "position".
supset
 the set from which elements are extractedname
 the string that the elements must begin withMethod Detail 
public Vector toVector()
public int size()
public void add(String s)
s
 the string to be added to the setpublic boolean remove(String s)
s
 the string to be removed from the setpublic String get(int i)
i
 the index of the element to be retrieved (0 is the first element)public MathSet union(MathSet b)
b
 the MathSet to be used to compute the unionpublic MathSet union(Vector b)
b
 the Vector to be used to compute the unionpublic MathSet diff(MathSet b)
b
 the MathSet to be used to compute the differencepublic MathSet diff(Vector b)
b
 the MathSet to be used to compute the differencepublic MathSet intersect(MathSet b)
b
 the MathSet to be used to compute the intersectionpublic MathSet intersect(Vector b)
b
 the MathSet to be used to compute the intersectionpublic String toString()
toString
in class Object
public void list()


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 