GP
Class Collection
java.lang.Object
|
+--GP.Collection
- Direct Known Subclasses:
- Bag, Matrix, Sequence
- public abstract class Collection
- extends java.lang.Object
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Collection
public Collection()
Copy
public Collection Copy()
GetBag
public java.util.Vector GetBag()
AddElement
public void AddElement(java.lang.Object item)
RemoveElement
public void RemoveElement(java.lang.Object item)
RemoveAllElements
public void RemoveAllElements()
NumElements
public int NumElements()
GetRandomElement
public java.lang.Object GetRandomElement()
Empty
public boolean Empty()
Contains
public boolean Contains(java.lang.Object item)
DoForEach
public void DoForEach(Doable action)
GetCurrentElement
public java.lang.Object GetCurrentElement(Doable action)
- Only to be used by the occurance passed into a DoForEach
- Returns:
- the current element in a clone of the sequence
EnsureSize
public void EnsureSize(int i)
- Parameters:
i
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object