com.sas.collection
Class AssociationList

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.collection.BaseCollection
              |
              +--com.sas.collection.AssociationList
All Implemented Interfaces:
AssociationListInterface, CollectionInterface, ComponentInterface, ContentsChangedSource, Countable, DeepClonable, DictionaryInterface, Enumerable, EventGateInterface, IndexedGetInterface, IndexedSetInterface, LinkPropertiesInterface, ModelInterface, MultipleValueEventSourceInterface, OrderedCollectionInterface, com.sas.beans.PropertyChangeSource, PublicClonable, Sortable, StaticCollectionInterface, StaticDictionaryInterface, StaticOrderedCollectionInterface, VetoableChangeSource, ViewInterface
Direct Known Subclasses:
ColorNameList, PersistedConnectionList, RGBList

public class AssociationList
extends BaseCollection
implements AssociationListInterface, DeepClonable

AssociationList is an implementation of AssociationListinterface, a collection which stores and retrieves values by either key or integer index. An AssociationList combines OrderedCollectionInterface and DictionaryInterface. It provides key/value pairs, but maintains an order to the data.

See Also:
Serialized Form

Field Summary
protected  OrderedCollectionInterface items
          items is the ordered collection of data items.
protected  OrderedCollectionInterface keys
          keys is the ordered collection of keys.
static String RB_KEY
           
 
Fields inherited from class com.sas.collection.BaseCollection
allContentsChangedListeners, mappingObject
 
Constructor Summary
AssociationList()
          Default Constructor
AssociationList(Class orderedCollectionClass)
          Constructor which allows you to choose of the type of collection to use for the internal implementation.
AssociationList(String data)
          Constructs a new association list populated with elements parsed from a string.
 
Method Summary
 void add(int index, Object key, Object item)
          Add an item into this association list at the specified index.
 void add(Object item)
          Add an item to this association list.
 void add(Object item, int index)
          Insert an item into a specific location in this association list.
 void addItems(Enumeration newItems)
          Add all elements of an enumeration to this association list.
 void addItems(Enumeration enum, int index)
          Add all elements of an enumeration to this collection at the specified location.
 void apply(ApplyInterface action)
          Applies the action to every item in the current association list.
 void applyToPairs(ApplyInterface action)
          Applies the 'apply' function in the action to all key/value pairs in the collection.
 Object clone()
          Clone the object.
 Object clone(DeepCloneSupport support, boolean deeply)
          Clone this object using a deep copy.
 boolean contains(Object item)
          Test the existence of an object in this association list.
 boolean containsKey(Object key)
          Test the existence of an key in a association list.
 int count()
          Returns the number of items in this association list
 int count(Object value)
          Count the number of times the value exists in this association list.
 int countKey(Object key)
          Count the number of times the given key is used in this association list
 void dumpComponent()
          Prints attribute information about the class.
 boolean equals(AssociationListInterface otherAssociationList)
          Compare the current items with those in another AssociationList and tell whether the collections are identical.
 boolean equals(Object object)
          Compare to another object
 boolean equals(StaticOrderedCollectionInterface orderedCollection)
          Compare the current items with those in another collection and tell whether the collections are identical.
protected  void fireContentsChanged(ContentsChangedEvent event, boolean notifyItemsChanged, boolean notifyKeysChanged)
          Send a ContentsChangedEvent event to all the ContentsChangedListener objects in the listener list.
 Object get(int index)
          Fetch an item at a index.
 Object get(Object key)
          Fetch the item corresponding to a key.
 Object get(Object key, int index)
          Fetch the item corresponding to a key.
static ExtendedBeanInfo getExtendedBeanInfo()
           
 int getIndex(Object element, int startIndex)
          Starting at startIndex, search forward for the first occurrence of item in this association list.
 Enumeration getItems()
          Return an enumeration of all the items
 Enumeration getItems(int start, int end)
          Return an enumeration of a range of items.
 Object getKey(int index)
          Get the key corresponding to a position
 Object getKey(Object item)
          Get the key corresponding to an item.
 Object getKey(Object item, int start)
          Get the item corresponding to an key Note that an association list may contain the same item via multiple keys.
 Enumeration getKeys()
          return an Enumeration of all the keys.
 Enumeration getKeys(Object item)
          Return an Enumeration of all the keys for a given item.
 int getLastIndex(Object element, int startIndex)
          Starting at startIndex, searche backwards towards item 0 and returns the index associated with the last occurence of the item in this association list.
 Enumeration getPairs()
          Returns an enumeration of all the key/value pairs from an association list.
 Enumeration getPairs(int start, int end)
          Returns an enumeration of the key/value item pairs from an association list
 boolean remove(Object item)
          Remove an item from this association list.
 void removeAll()
          remove all items from this association list
 int removeAll(Object item)
          Remove an item from this association list.
 void removeAllAt(Object key)
          Remove all items with the specified key.
 Object removeAt(int index)
          Remove from this association list the item at the specified index.
 void removeAt(Object key)
          Remove the item corresponding to the specified key.
 void removeAt(Object key, int start)
          Remove the item corresponding to the specified key.
 void set(int index, Object item)
          Replace the item at the specified index with a new item.
 void set(int index, Object key, Object item)
          Put an item into this association list, replacing a previous item that was there by the same key/index.
 void set(Object key, Object item)
          Put an item into this association list, possibly replacing a previous item that was there by the same key
 void setKey(int index, Object key)
          Set the key corresponding to a position
 void setSize(int newSize)
          Set the number of items that are being held in this association list.
 void sort(Comparator comparator)
          Sorts the items from the current collection using the provided comparison function.
 void sort(Comparator comparator, int start, int end)
          Sorts the current collection in place using the provided comparison function.
 String toString()
          Convert this association list to a single string.
 String toString(char delimiter, char separator, boolean alwaysQuote)
          Convert this association list to a single string.
 
Methods inherited from class com.sas.collection.BaseCollection
addContentsChangedListener, anyContentsChangedListeners, disableEvents, enableEvents, enableEvents, fireContentsChanged, map, removeContentsChangedListener, unmap
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, detachModel, detachView, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sas.collection.ContentsChangedSource
addContentsChangedListener, removeContentsChangedListener
 
Methods inherited from interface com.sas.beans.PropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

RB_KEY

public static final String RB_KEY

items

protected OrderedCollectionInterface items
items is the ordered collection of data items.

keys

protected OrderedCollectionInterface keys
keys is the ordered collection of keys. The items and keys collections must be kept in sync and always have the same length.
Constructor Detail

AssociationList

public AssociationList()
Default Constructor

AssociationList

public AssociationList(Class orderedCollectionClass)
Constructor which allows you to choose of the type of collection to use for the internal implementation.
Parameters:
orderedCollectionClass - a class to instantiate to store the keys and items. This class must have a public no-arg constructor and must implement the com.sas.collection.OrderedCollectionInterface
Throws:
IllegalArgumentException - if an exception is caught trying to instantiate the orderedCollectionClass

AssociationList

public AssociationList(String data)
Constructs a new association list populated with elements parsed from a string.
Parameters:
data - a string of key=value pairs, separated by the delimiter returned from con.sas.util.Util.getListDelimiterChar(). Booleans and Numbers are recognized and parsed into appropriate java.lang.Boolean, java.lang.Integer, java.lang.Long, or java.lang.Double objects (for either the key or the value); everything else is parsed into a String or Character. For example, new AssociationList("A=1,two=2,3=true") results in an association list with three values. The keys are "A", "two", and the Integer 3, and the values are the Integer 1, the Integer 2, and Boolean.TRUE when the default delimiter returned from com.sas.util.Util.getListDelimiterChar() is a comma. Be sure to use the character returned from the com.sas.util.Util.getListDelimiterChar() method as the delimiter when forming the string to get parsed.
Throws:
IllegalArgumentException - if the data string is invalid
See Also:
StringToDictionaryInterfaceTransform
Method Detail

getExtendedBeanInfo

public static ExtendedBeanInfo getExtendedBeanInfo()

fireContentsChanged

protected void fireContentsChanged(ContentsChangedEvent event,
                                   boolean notifyItemsChanged,
                                   boolean notifyKeysChanged)
Send a ContentsChangedEvent event to all the ContentsChangedListener objects in the listener list. The event is sent only to each item which is in the list at the time of this copy, even if adds or removes are performed after the send has started. Also fires a null-content propertyChange event.
Parameters:
event - the event to send

set

public void set(int index,
                Object key,
                Object item)
Put an item into this association list, replacing a previous item that was there by the same key/index.
Specified by:
set in interface AssociationListInterface
Parameters:
index - where in the implicit order to set the item.
key - the key by which the item may be retrieved later.
item - the value to put into this association list

add

public void add(int index,
                Object key,
                Object item)
Add an item into this association list at the specified index. The item and key will be available via get(index) and getKey(index)
Specified by:
add in interface AssociationListInterface
Parameters:
index - where in the implicit order to insert the item.
key - the key by which the item may be retrieved later.
item - the value to put into this association list

removeAllAt

public void removeAllAt(Object key)
Remove all items with the specified key.
Specified by:
removeAllAt in interface AssociationListInterface
Parameters:
key - remove all items with this key.

removeAll

public int removeAll(Object item)
Remove an item from this association list. All occurrences of the item are removed.
Specified by:
removeAll in interface CollectionInterface
Parameters:
item - the item to remove
Returns:
the number of items removed

add

public void add(Object item)
Add an item to this association list. Since no key is given, the item is also used as the key to minimize conflicts with preexisting items.
Specified by:
add in interface CollectionInterface
Parameters:
item - an object to add to this association list

addItems

public void addItems(Enumeration newItems)
Add all elements of an enumeration to this association list. This will perform an add(item, item) for each element of the Enumeration.
Specified by:
addItems in interface CollectionInterface
Parameters:
newItems - an Enumeration of items to add to this association list
See Also:
CollectionInterface

apply

public void apply(ApplyInterface action)
Applies the action to every item in the current association list.
Specified by:
apply in interface StaticCollectionInterface
Overrides:
apply in class BaseCollection
Parameters:
action - An object that performs some action to another object. action.apply(pair) is excecuted on successive key/value pairs until all pairs in the this association list have been operated on, or until the method returns ApplyInterface.ABORT

removeAll

public void removeAll()
remove all items from this association list
Specified by:
removeAll in interface CollectionInterface

contains

public boolean contains(Object item)
Test the existence of an object in this association list. This only searches for the item in the values, not the keys.
Specified by:
contains in interface StaticCollectionInterface
Overrides:
contains in class BaseCollection
Parameters:
item - the item to search for
Returns:
true if and only the item exists as a value in this association list.

containsKey

public boolean containsKey(Object key)
Test the existence of an key in a association list. This only searches for the key in the keys, not the values.
Specified by:
containsKey in interface StaticDictionaryInterface
Parameters:
key - the key to search for
Returns:
true if and only an item with the specified key exists in this association list.

count

public int count()
Returns the number of items in this association list
Specified by:
count in interface Countable
Overrides:
count in class BaseCollection
Returns:
the number of items in this association list

count

public int count(Object value)
Count the number of times the value exists in this association list.
Parameters:
value - a value to count
Returns:
the number of times the value exists in this association list.

countKey

public int countKey(Object key)
Count the number of times the given key is used in this association list
Parameters:
key - the association list key to count
Returns:
the number of times the key appears in the list

dumpComponent

public void dumpComponent()
Prints attribute information about the class.
Overrides:
dumpComponent in class com.sas.Component

get

public Object get(int index)
Fetch an item at a index.
Specified by:
get in interface IndexedGetInterface
Parameters:
index - the position of the item, zero-based indexing.
Returns:
the item associated with the index value
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()-1].
See Also:
get(java.lang.Object,int), get(java.lang.Object)

get

public Object get(Object key)
Fetch the item corresponding to a key.
Specified by:
get in interface StaticDictionaryInterface
Parameters:
key - the Object key with which the item was added to this association list
Returns:
the item in this association list which corresponds to the given key. This method returns the first item matching the key.
Throws:
NoSuchElementException - when there is no entry for the specified key. (Note that null is a valid value for a key.)
See Also:
get(java.lang.Object,int), get(int)

get

public Object get(Object key,
                  int index)
Fetch the item corresponding to a key.
Specified by:
get in interface AssociationListInterface
Parameters:
key - the Object key with which the item was added to this association list
index - start searching for the key at this index
Returns:
the item in this association list which corresponds to the given key. There may be only one item per key.
Throws:
NoSuchElementException - when there is no entry for the specified key. (Note that null is a valid value for a key.)
See Also:
get(java.lang.Object), get(int)

getItems

public Enumeration getItems()
Return an enumeration of all the items
Specified by:
getItems in interface Enumerable
Overrides:
getItems in class BaseCollection
Returns:
java.util.Enumeration An enumeration of the elements stored in this association list (not the keys).

getItems

public Enumeration getItems(int start,
                            int end)
Return an enumeration of a range of items.
Specified by:
getItems in interface StaticOrderedCollectionInterface
Parameters:
start - the index of the first item in the range of items to get
end - get the items between start and (end-1)
Returns:
java.util.Enumeration An enumeration of the elements stored in this association list (not the keys).

getKey

public Object getKey(Object item)
Get the key corresponding to an item. Note that an association list may contain the same item via multiple keys. If so, this method returns one, but the interface does not specify which one (i.e. it does not have to be the first one entered in this association list, or the first one as found in the getItems() enumeration).
Specified by:
getKey in interface StaticDictionaryInterface
Parameters:
item - the item whose key you wish to find.
Returns:
the key for the item, or null if the item is not found.
Throws:
NoSuchElementException - if the item is not found

getKey

public Object getKey(Object item,
                     int start)
Get the item corresponding to an key Note that an association list may contain the same item via multiple keys. This method returns the first one as found at or after start
Specified by:
getKey in interface AssociationListInterface
Parameters:
item - the item whose key you wish to find.
start - the index of where to start searching
Returns:
the key for the item, or null if the item is not found.
Throws:
NoSuchElementException - if the item is not found
IndexOutOfBoundsException - if if the index is invalid

getKey

public Object getKey(int index)
Get the key corresponding to a position
Specified by:
getKey in interface AssociationListInterface
Parameters:
index - return the key corresponding to this index
Returns:
the key for the item, or null if the item is not found.
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()-1]

setKey

public void setKey(int index,
                   Object key)
Set the key corresponding to a position
Specified by:
setKey in interface AssociationListInterface
Parameters:
index - replace the key at this index
key - the new key
Returns:
the key found at the specified index
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()-1]

getKeys

public Enumeration getKeys(Object item)
Return an Enumeration of all the keys for a given item. The order is unspecified. If the item does not exist, the Enumeration will be non-null but not have any elements.
Specified by:
getKeys in interface StaticDictionaryInterface
Parameters:
item - the item to search for
Returns:
an Enumeration of keys corresponding to the item.

getKeys

public Enumeration getKeys()
return an Enumeration of all the keys. note that this enumeration may be "larger" than the enumeration of elements.
Specified by:
getKeys in interface StaticDictionaryInterface
Returns:
an Enumeration of all the keys

remove

public boolean remove(Object item)
Remove an item from this association list. If the item appears multiple times, only the first occurrence is removed.
Specified by:
remove in interface CollectionInterface
Parameters:
the - item to remove
Returns:
boolean True if item removed, false if not.

removeAt

public void removeAt(Object key,
                     int start)
Remove the item corresponding to the specified key.
Parameters:
key - remove the item which corresponds to this key
start - start index for finding the key.

removeAt

public void removeAt(Object key)
Remove the item corresponding to the specified key.
Specified by:
removeAt in interface DictionaryInterface
Parameters:
key - remove the item which corresponds to this key

getIndex

public int getIndex(Object element,
                    int startIndex)
Starting at startIndex, search forward for the first occurrence of item in this association list.
Specified by:
getIndex in interface StaticOrderedCollectionInterface
Parameters:
element - item to search for
startIndex - the position where the search should start
Returns:
the zero-based index corresponding to the first occurrence of item, or -1 if the item is not found.
Throws:
IndexOutOfBoundsException - if the index is not in the range [0..count()-1].
ClassCastException - In some implementations, the objects that are stored may be restricted to a particular type (such as String). (a RuntimeException)

getLastIndex

public int getLastIndex(Object element,
                        int startIndex)
Starting at startIndex, searche backwards towards item 0 and returns the index associated with the last occurence of the item in this association list.
Specified by:
getLastIndex in interface StaticOrderedCollectionInterface
Parameters:
element - item to search for
startIndex - the position where the search should start
Returns:
the zero-based index corresponding to the last occurrence of item or -1 if the item is not found.
Throws:
IndexOutOfBoundsException - if the index is not in the range [0..count()-1].
ClassCastException - In some implementations, the objects that are stored may be restricted to a particular type (such as String). (a RuntimeException)

set

public void set(Object key,
                Object item)
Put an item into this association list, possibly replacing a previous item that was there by the same key
Specified by:
set in interface DictionaryInterface
Parameters:
key - the key by which the item may be retrieved later.
item - the value to put into this association list

clone

public Object clone()
             throws CloneNotSupportedException
Clone the object.
Specified by:
clone in interface AssociationListInterface
Overrides:
clone in class BaseCollection
Returns:
a clone of this association list.
Throws:
CloneNotSupportedException - if the clone fails.

clone

public Object clone(DeepCloneSupport support,
                    boolean deeply)
             throws CloneNotSupportedException
Clone this object using a deep copy. With this method, this class implements DeepClonable This object and all the objects it contains are cloned, preserving the same structure.
Specified by:
clone in interface DeepClonable
Parameters:
support - 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.

equals

public boolean equals(StaticOrderedCollectionInterface orderedCollection)
Compare the current items with those in another collection and tell whether the collections are identical. If the orderedCollection is an AssociationListInterface, then return equals((AssociationListInterface) orderedCollection), else compare the ordered collection to this association lists' items.
Specified by:
equals in interface StaticOrderedCollectionInterface
Parameters:
orderedCollection - Another ordered collection to be compared to. May be null (returns false)
Returns:
true if the orderedCollection is an AssociationListInterface and the two association lists are equals, or if the orderedCollection equals the items of this association lists.

equals

public boolean equals(AssociationListInterface otherAssociationList)
Compare the current items with those in another AssociationList and tell whether the collections are identical.
Parameters:
otherAssociationList - Another AssociationList to be compared to. May be null (returns false)
Returns:
true if the keys and values are equal and in the same order, else false.

equals

public boolean equals(Object object)
Compare to another object
Overrides:
equals in class Object
Parameters:
object - another object
Returns:
if the other object is an AssociationListInterface, return equals((AssociationListInterface) other), else if the object is a StaticOrderedCollectionInterface, return equals((StaticOrderedCollectionInterface) object), else return false

add

public void add(Object item,
                int index)
Insert an item into a specific location in this association list.
Specified by:
add in interface OrderedCollectionInterface
Parameters:
item - the item to add to this association list. The item may exist multiple times in this association list.
index - Insert the object before the indexed item. The newly inserted item can be accessed by get(index) afterwards.
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()].
ClassCastException - In some implementations, the objects that are stored may be restricted to a particular type (such as String). (a RuntimeException)

addItems

public void addItems(Enumeration enum,
                     int index)
Add all elements of an enumeration to this collection at the specified location.
Specified by:
addItems in interface OrderedCollectionInterface
Parameters:
enum - an Enumeration of items to add to this association list
index - Insert the objects starting before the indexed item. The first of the newly inserted item can be accessed by get(index) afterwards.
Throws:
ClassCastException - In some implementations, the objects that are stored may be restricted to a particular type (such as String). (a RuntimeException)

removeAt

public Object removeAt(int index)
Remove from this association list the item at the specified index. The items after the deleted item are shifted backward to fill in the hole.
Specified by:
removeAt in interface OrderedCollectionInterface
Parameters:
index - the position of the item, zero-based indexing.
Returns:
the item that was removed from this association list
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()-1].

set

public void set(int index,
                Object item)
Replace the item at the specified index with a new item.
Specified by:
set in interface OrderedCollectionInterface
Parameters:
index - The position where the Object will be placed.
item - The Object to be added to this association list.
Throws:
IndexOutOfBoundsException - if index is not in the range [0, count()-1].
ClassCastException - In some implementations, the objects that are stored may be restricted to a particular type (such as String). (a RuntimeException)

setSize

public void setSize(int newSize)
Set the number of items that are being held in this association list. If size is smaller than the current collection size, then this association list is truncated to the size specified. If size is greater than the current collection size, then this association list size is extended, and the new collection slots are set to contain null.
Specified by:
setSize in interface OrderedCollectionInterface
Parameters:
size - The new size of this association list
Throws:
IndexOutOfBoundsException - if index is less than zero.

sort

public void sort(Comparator comparator)
Sorts the items from the current collection using the provided comparison function. The sort is performed in place.
Specified by:
sort in interface Sortable
Parameters:
comparator - An instance of a subclass of Comparator which provides a compare(Object,Object) function.
See Also:
Comparator

sort

public void sort(Comparator comparator,
                 int start,
                 int end)
Sorts the current collection in place using the provided comparison function.
Specified by:
sort in interface Sortable
Parameters:
comparator - A Comparator which provides a compare(Object,Object) method. The values passed to the comparator are Pair objects which contain the key and the value for a slot in this association list. The pair.getFirst() is the key; pair.getSecond() is the value, so your comparator must cast the Object parameter to a Pair and extract the key and value in order to make a comparison. Or, you can use a PairFirst or PairSecond object wrapped around a simpler comparator. Use a new PairFirst(comparator) object around your comparator if you want to sort by key only; just keys will be extracted from the two items and passed to your comparator. Use a PairSecond(comparator) object if you want to sort by value only; the values will be extracted from the two items and passed to your comparison.
start - the index of the first item in the range to sort
end - sort the items between start and (end-1)
See Also:
Pair, PairFirst, PairSecond

applyToPairs

public void applyToPairs(ApplyInterface action)
Applies the 'apply' function in the action to all key/value pairs in the collection. This is a general way to modify all the items in a collection.
Specified by:
applyToPairs in interface AssociationListInterface
Parameters:
action - An object that provides a function which takes an object as an argument and then does something to it. The values passed to the Comparator function are Pair objects which contain the key and the value. In each returned Pair, the pair.getFirst() is the key; pair.getSecond() is the value. The application of the action continues until all items in the this association list have been operated on, or until a call to the action.apply(Object item) method returns ApplyInterface.ABORT
See Also:
Pair

getPairs

public Enumeration getPairs()
Returns an enumeration of all the key/value pairs from an association list.
Specified by:
getPairs in interface AssociationListInterface
Returns:
an enumeration of the requested elements; getItems(0, count())

getPairs

public Enumeration getPairs(int start,
                            int end)
Returns an enumeration of the key/value item pairs from an association list
Specified by:
getPairs in interface AssociationListInterface
Parameters:
start - the index of the first item, zero based.
end - one past the index of the last item to include in the enumeration, zero based. -1 indicates that the enumeration should return all remaining items, even if items are added/removed before the enumeration gets to them. (If you pass count() for the end parameter, the enumeration will save the end value and stop there, even if more items are added to this association list after the enumeration was created.)
Returns:
an enumeration of Pair objects of the requested elements. In each returned Pair, the pair.getFirst() is the key; pair.getSecond() is the value.
Throws:
IndexOutOfBoundsException - if start is not in the range [0, count()-1], or start>last or end is not in the range [0, count()]

toString

public String toString()
Convert this association list to a single string.
Overrides:
toString in class Object
Returns:
a string consisting of the quoted key=value pairs of this association list separated by commas.

toString

public String toString(char delimiter,
                       char separator,
                       boolean alwaysQuote)
Convert this association list to a single string.
Parameters:
delimiter - a delimiter for separating the items.
separator - a separator which appears between the keys and the values
alwaysQuote - if true, all items are quoted. If false, only quote items which require quotes (such as strings containing the delimiter character, or the '\' character, etc.)
Returns:
a string consisting of the optionally quoted elements of this association list separated by a delimiter.




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 01:48:05