|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is the root interface in the javasupport.collection package. Use it for immutable Collections of Objects.
Use a direct implementation of this interface, like Bag, to handle an immutable multiset.
All implementations of javasupport.collection.Collection should include two constructors. One should have a single argument Collection (or a sub interface) which creates a copy of the argument. The second should have a single argument of java.util.Collection.
javasupport.collection.Collection implementations should not mess with the normal java equals() and hashCode() methods. Doing so prevents creating a mutable Collection of mutable Collections.
A Collection has the same state as another collection (for the HasState interface) if sameContentsAs() is true and the two collection's non-private state is the same.
Method Summary | |
boolean |
contains(java.lang.Object object)
Returns true if this collection contains the specified Object. |
boolean |
containsAll(Collection c)
Returns true if this collection contains all of the Objects in the specified collection. |
Identitor |
getIdentitor()
Returns the Identitor for this Collection. |
java.util.Collection |
getJavaCollection()
Return a java.util.Collection of these Objects. |
boolean |
isEmpty()
Returns true if this collection contains no elements. |
java.util.Iterator |
iterator()
Returns an iterator over the Objects in this collection. |
boolean |
sameContentsAs(Collection c)
Returns true if this Collection's contents are equal to c's. |
int |
size()
Returns the number of elements in this collection. |
Methods inherited from interface net.walend.collection.HasState |
getPrincipleInterface, sameStateAs |
Method Detail |
public Identitor getIdentitor()
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object object)
public java.util.Iterator iterator()
public boolean containsAll(Collection c)
public boolean sameContentsAs(Collection c)
public java.util.Collection getJavaCollection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |