|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpolyglot.util.SubtypeSet
Class to implement sets containing polyglot.types.Type .
Set membership is based on the subtype relationships. Thus, if
S is a supertype of A and B, then
{ S } union { A,B } =
{ S }. Similarily, we remove elements from the set such
that if s is an element of a set S, then a
call to remove r removes all s s.t. r is a
a supertype of s.
| Constructor Summary | |
SubtypeSet(SubtypeSet s)
Creates a copy of the given SubtypeSet |
|
SubtypeSet(Type top)
|
|
SubtypeSet(Type top,
java.util.Collection c)
|
|
SubtypeSet(TypeSystem ts)
Creates an empty SubtypeSet |
|
SubtypeSet(TypeSystem ts,
java.util.Collection c)
|
|
| Method Summary | |
boolean |
add(java.lang.Object o)
Add an element of type polyglot.types.Type to the set
only if it has no supertypes already in the set. |
boolean |
addAll(java.util.Collection c)
Adds all elements from c into this set. |
void |
clear()
Removes all elements from the set |
boolean |
contains(java.lang.Object o)
Check whether object o is in the set. |
boolean |
containsAll(java.util.Collection c)
Checks whether all elements of the collection are in the set |
boolean |
containsSubtype(Type type)
Check whether the type t or a subtype is in the set. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object o)
Removes all elements s in the set such that
s decends from o |
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
equals, hashCode |
| Constructor Detail |
public SubtypeSet(TypeSystem ts)
public SubtypeSet(Type top)
public SubtypeSet(SubtypeSet s)
public SubtypeSet(TypeSystem ts,
java.util.Collection c)
public SubtypeSet(Type top,
java.util.Collection c)
| Method Detail |
public boolean add(java.lang.Object o)
polyglot.types.Type to the set
only if it has no supertypes already in the set. If we do add it,
remove any subtypes of o
add in interface java.util.Seto - The element to add.public boolean addAll(java.util.Collection c)
addAll in interface java.util.Setpublic void clear()
clear in interface java.util.Setpublic boolean contains(java.lang.Object o)
o is in the set. Because of the
semantics of the subtype set, o is in the set iff
it descends from (or is equal to) one of the elements in the set.
contains in interface java.util.Setpublic boolean containsSubtype(Type type)
t or a subtype is in the set.
Returns true iff it descends from, is equal to, or is a super type of
one of the elements in the set.
public boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Setpublic boolean isEmpty()
isEmpty in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.util.Setpublic boolean remove(java.lang.Object o)
s in the set such that
s decends from o
remove in interface java.util.Setpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.Setpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.Setpublic int size()
size in interface java.util.Setpublic java.lang.Object[] toArray()
toArray in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.Setpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||