Note:
Extension of the classes in this package is prohibited unless otherwise documented. Similarly, extension or implementation of the interfaces in this package is prohibited except as documented.
@CodeSet(value="sas.platform")
@SASScope(value="ALL")

Package com.sas.collection

Provides several classes which implement data structures called collections.

See:
          Description

Interface Summary
AssociationListInterface AssociationListInterface combines the OrderedCollection interface and the DictionaryInterface interface, yielding a collection whose items may be accessed by either an index or a key.
CollectionInterface A collection interface, for objects which store and retrieve values.
DictionaryInterface A dictionary interface, for objects which store and retrieve values by name
OrderedCollectionInterface An ordered collection is a collection which accesses items via consecutive integer indices.
PropertyBagChangedListener An interface for listeners for PropertyBagChangedEvent events.
PropertyBagChangedSource Define a type (interface) for an object which emits com.sas.collection.PropertyBagChangedEvent events.
PropertyBagInterface A PropertyBagInterface defines a set of properties, much like a Dictionary but simpler: keys must be Strings.
Sortable Sortable defines an interface for collections or other objects which may be sorted based on some comparison.
SortedCollectionInterface SortedCollectionInterface defines an interface for an ordered collection which preserves a sort order when inserting items.
StaticCollectionInterface A static collection interface, for access to but not update of a collection.
StaticDictionaryInterface A static dictionary interface, for objects which retrieve values by an Object key.
StaticOrderedCollectionInterface A static ordered collection interface defines read access to items in an ordered collection.
StaticPropertyBagInterface A StaticPropertyBagInterface defines a read-only set of properties, much like a Dictionary but simpler: keys must be Strings.
StaticStringListInterface The StaticStringListInterface interface is a read-only ordered collection of strings.
StringCollectionInterface StringCollectionInterface combines StringListInterface and OrderedCollectionInterface.
StringListInterface An interface for an ordered, modifiable collection of strings.
 

Class Summary
AssociationList AssociationList is an implementation of AssociationListinterface, a collection which stores and retrieves values by either key or integer index.
BaseCollection Abstract base class for collections.
Collection A implementation of CollectionInterface, for objects which store and retrieve values.
CollectionChangedInfo CollectionChangedInfo is a ContentsChangedEvent event object that is created and sent when a Collection has changed.
CollectionMirror A CollectionMirror is an abstract base class for other read-only collections which "reflect" other collections.
CompositeProperties CompositeProperties is a subclass of Dictionary A Dictionary stores and retrieves values by a key.
DictionaryChangedInfo DictionaryChangedInfo is a ContentsChangedEvent event object that is created/sent when a Dictionary has changed.
HowChanged An Enumeration class.
OrderedCollection An ordered collection is a collection which accesses items via consecutive integer indices.
OrderedListChangedInfo OrderedListChangedInfo provides information about how an ordered list collection has changed.
OrderedListCollection An OrderedListCollection is a linked list implementation of OrderedCollectionInterface.
Permuter Permutes the items in an ordered collection according to a index reordering.
PredicateEnumeration PredicateEnumeration filters an PrintContents A small class used to dump the contents of collections.
PropertyBag A PropertyBag defines a collection of properties, much like a Dictionary but simpler.
PropertyBagChangedEvent A property change event which tells how the property in a property bag has changed.
PropertyBagChangedListenerList Manage a list of listeners for the com.sas.collection.PropertyBagChangedEvent event.
Queue A Queue is an object which refers to a linked list of objects that are placed at the end of the list when added, and removed from the beginning of the list when removed.
Set A Set is a Collection which does not allow duplicates elements.
SortedCollection SortedCollection is a collection which inserts items in a sort order defined by a Comparator.
StaticCollection A StaticCollection is a class which hides the update methods of a collection object.
StaticDictionary A StaticDictionary is a class which hides the update methods of a dictionary object.
StaticOrderedCollection A StaticOrderedCollection is a class which hides the update methods of a OrderedCollection object.
StaticStringList A StaticStringList is a class which hides the update methods of a StringList object.
StringCollection A StringCollection is an ordered collection of java.lang.String values.
StringPredicateEnumeration StringPredicateEnumeration filters an
Exception Summary
InvalidElementTypeException Deprecated. Classes should use java.lang.IllegalArgumentException or java.lang.ClassCastException in such circumstances.
 

Package com.sas.collection Description

Provides several classes which implement data structures called collections. These collection classes provide the following features not found in the Java 1.1 core libraries:

interface based
The classes are designed around several key interfaces. All collections implement com.sas.collection.StaticCollectionInterface. This interface itself extends several smaller interfaces:
com.sas.util.Countable
defines the count() method;
com.sas.util.Enumerable
defines the getItems() method for obtaining a java.util.Enumeration;
com.sas.collection.ContentsChangedListener
defines the event subscription mechanism;
com.sas.PublicClonable
allows all collections to be cloned; and
java.io.Serializable
for serialization.

com.sas.collection.StaticOrderedCollectionInterface and com.sas.collection.OrderedCollectionInterface defines access to ordered collections -- collections which access items via an integer index, much like an array. See also com.sas.util.IndexedGetInterface and com.sas.util.IndexedSetInterface

Model/View based design
The collection classes fire a com.sas.collection.ContentsChangedEvent when the contents of the collection are modified, such as items being added to or removed from or replaced in the collection, or when an ordered collection is sorted or otherwise rearranged.
Sorting
The ordered collections may be sorted using a flexible comparison interface, com.sas.util.Comparator.
Consistent API
Whereas the different JDK collections class define similar operations with inconsistent names, the com.sas.collections use a much more uniform method naming convention, due mostly to the common interfaces the collections implement.

See also some notes about the Performance Characteristics of com.sas.collection Classes


Key Interfaces

Below is a diagram which shows the significant interfaces in the collection classes, and how they inherit from one another. com.sas.collection.StaticCollectionInterface is the central interface. Click on an interface name to view the documentation for that interface.


Logical View

The following are the most important interfaces in the com.sas.collection package:
  1. StaticOrderedCollectionInterface
  2. StaticCollectionInterface, CollectionInterface
  3. ContentsChangedListener, ContentsChangedSource

Key Classes
The following are the key classes in the com.sas.collection package:
  1. OrderedCollection, OrderedListCollection
  2. Collection, Set
  3. Dictionary,
  4. StringCollection
  5. ContentsChangedEvent
  6. AssociationList

Utility Classes
The following classes serve utility roles. They are more useful for internal implementation of other classes, since they may not implement all of the collection or com.sas.Component interfaces
  1. PropertyBag,
  2. LongKeyDictionary
  3. Pair, PairFirst, PairSecond
  4. StaticDictionary, StaticCollection, StaticOrderedCollection,


Note:
Extension of the classes in this package is prohibited unless otherwise documented. Similarly, extension or implementation of the interfaces in this package is prohibited except as documented.


Copyright © 2009 SAS Institute Inc. All Rights Reserved.