|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.collection.Collection
public class Collection
A implementation of CollectionInterface, for objects which store and retrieve values. This collection can act as a set (an item cannot exist more than once in the collection at any time), or it can allow duplicates. If the collection has set semantics, tests for containment etc. rely on identity comparisons, not equality comparisons.
Set,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Fields inherited from class com.sas.collection.BaseCollection |
|---|
allContentsChangedListeners, mappingObject |
| Constructor Summary | |
|---|---|
Collection()
Default Constructor. |
|
Collection(boolean isSet)
Construct a collection with set semantics. |
|
Collection(java.lang.String data)
Construct an Collection from a string of comma delimited values |
|
Collection(java.lang.String data,
boolean isSet)
Construct an Collection from a string of comma delimited values. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object item)
Add an item to a collection. |
void |
addItems(java.util.Enumeration items)
Add all elements of an enumeration to this collection. |
void |
apply(com.sas.util.ApplyInterface action)
Applies the action to every item in the collection. |
java.lang.Object |
clone()
Clone a Collection. |
java.lang.Object |
clone(com.sas.DeepCloneSupport support,
boolean deeply)
Clone this object using a deep copy. |
boolean |
contains(java.lang.Object item)
Test if this collection contains an object. |
int |
count()
Returns the number of items in this collection |
void |
dumpComponent()
Prints the collection to System.out. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
java.util.Enumeration |
getItems()
Return an enumeration of all the elements. |
boolean |
isSet()
Return true if this collection is a set, false otherwise. |
boolean |
remove(java.lang.Object item)
Remove an item from this collection. |
void |
removeAll()
Remove all items from this collection. |
int |
removeAll(java.lang.Object item)
Remove all occurrences of an item from this collection. |
static java.lang.Object |
toArray(StaticCollectionInterface collection)
Return a new array of objects containing the contents of this collection. |
java.lang.String |
toString()
Convert this collection to a single string. |
| Methods inherited from class com.sas.collection.BaseCollection |
|---|
addContentsChangedListener, anyContentsChangedListeners, disableEvents, enableEvents, enableEvents, fireContentsChanged, map, removeContentsChangedListener, unmap |
| Methods inherited from interface com.sas.collection.ContentsChangedSource |
|---|
addContentsChangedListener, removeContentsChangedListener |
| Methods inherited from interface com.sas.beans.PropertyChangeSource |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public Collection()
public Collection(boolean isSet)
isSet - if true, this collection acts like a set; that
is, it does not allow duplicate values.Set
public Collection(java.lang.String data,
boolean isSet)
data - a string values, separated by commas.
Boolean and number objects are recognized and parsed into
appropriate Boolean, Integer, Long,
or Double objects;
everything else is parsed into a String
or Character.isSet - if true, this collection acts like a set; that
is, it does not allow duplicate values.
java.lang.IllegalArgumentException - if the data string
is invalidSet,
StringToCollectionInterfaceTransformpublic Collection(java.lang.String data)
data - a string values, separated by commas.
java.lang.IllegalArgumentException - if the data string
is invalidCollection(String, boolean)| Method Detail |
|---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public boolean isSet()
true if this collection is a set, false otherwise.
true if this collection is a set (i.e. does not allow
a single item to be added more than one time), false otherwise.
If the collection is not a set, you can add an item multiple times.
Note that you cannot change the set behavior of a collection.public void add(java.lang.Object item)
add in interface CollectionInterfaceitem - an object to add to this collectionpublic void addItems(java.util.Enumeration items)
* targetCollection.addItems(otherCollection.getItems()).
addItems in interface CollectionInterfaceitems - an Enumeration of items to add to this collection
java.lang.ClassCastException - In some implementations,
the objects that are stored may be restricted to a particular
type (such as String).public void apply(com.sas.util.ApplyInterface action)
apply in interface StaticCollectionInterfaceapply in class BaseCollectionaction - An object that provides a function which takes an
object as an argument and then does something to it.public void removeAll()
removeAll in interface CollectionInterfacepublic boolean contains(java.lang.Object item)
contains in interface StaticCollectionInterfacecontains in class BaseCollectionitem - the item to search for
true if and only the item existsStaticCollectionInterface.contains(java.lang.Object)public int count()
count in interface com.sas.util.Countablecount in class BaseCollectionpublic void dumpComponent()
dumpComponent in interface ComponentInterfacedumpComponent in class ComponentComponentInterface.dumpComponent()public java.util.Enumeration getItems()
getItems in interface com.sas.util.EnumerablegetItems in class BaseCollectionEnumerable.getItems()public boolean remove(java.lang.Object item)
remove in interface CollectionInterfaceitem - The item to remove
true if item removed, false if not.public int removeAll(java.lang.Object item)
removeAll in interface CollectionInterfaceitem - the item to remove
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface CollectionInterfaceclone in interface StaticCollectionInterfaceclone in interface com.sas.PublicClonableclone in class BaseCollectionjava.lang.CloneNotSupportedException - if the clone fails.
public java.lang.Object clone(com.sas.DeepCloneSupport support,
boolean deeply)
throws java.lang.CloneNotSupportedException
DeepClonable
This object and all the objects it contains
are cloned, preserving the same structure.
clone in interface com.sas.DeepClonablesupport - a required object which keeps track
of cloned objects during the deep cloning.deeply - If true, clone recursively using the deep clone support.
if false, this is equivalent to a normal clone.
java.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectStaticCollectionInterfaceToStringTransformpublic static java.lang.Object toArray(StaticCollectionInterface collection)
collection - a non-null object implementing the StaticCollectionInterface
length == count()
The array may contain null items.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||