com.sas.metadata.remote
Class AssociationList

com.sas.metadata.remote.AssociationList
All Implemented Interfaces:
MetadataState, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List

public class AssociationList
implements MetadataState, java.io.Serializable, java.lang.Cloneable

Extension of List to manage associations between objects.

See Also:
Serialized Form

Field Summary
protected  com.sas.metadata.remote.MdObjectList list_object
          This is the object used for list interactions internally.
protected  int modCount
          The number of times this list has been structurally modified.
 
Fields inherited from interface com.sas.metadata.remote.MetadataState
AL_ALL, AL_ITEM_ADDED, AL_ITEM_CHANGED, AL_ITEM_REMOVED, AL_LOCALSET, AL_PARTIALSET, AL_SETFROMSERVER, AL_UNCHANGED, AL_UPDATEALL, LOCAL, MD_CHGMGT_CHECKEDOUT, MD_CHGMGT_FETCHED, MD_CHGMGT_NEW, MD_CHGMGT_UNSET, MD_OBJECT_MODIFIED, MD_OBJECT_NOT_MODIFIED, MD_OBJECT_STALE, MD_OBJECT_UNSET, SERVER, UNSET
 
Constructor Summary
AssociationList(java.lang.String strAssociationName)
          Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.
AssociationList(java.lang.String strAssociationName, boolean remoteEnvironment)
          Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.
AssociationList(java.lang.String strAssociationName, java.util.Collection<CMetadata> c)
          Constructs a List containing the elements of the specified collection, in the order they are returned by the collection's iterator.
AssociationList(java.lang.String strAssociationName, java.util.Collection<CMetadata> c, CMetadata parentObj)
          Constructs a List containing the elements of the specified collection, in the order they are returned by the collection's iterator.
AssociationList(java.lang.String strAssociationName, int initialCapacity)
          Constructs an empty List with the specified initial capacity and with its capacity increment equal to zero.
AssociationList(java.lang.String strAssociationName, int initialCapacity, boolean remoteEnvironment)
          Constructs an empty List with the specified initial capacity and with its capacity increment equal to zero.
AssociationList(java.lang.String strAssociationName, int initialCapacity, int capacityIncrement)
          Deprecated. this constructor is no longer supported
AssociationList(java.lang.String strAssociationName, java.lang.Object obj)
          Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.
AssociationList(java.lang.String strAssociationType, java.lang.String strAssociationName, boolean isPredAssoc, java.lang.String properties, CMetadata parentObj)
          Constructs an empty AssociationList with capacity 10 and the properties set accordingly.
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this List.
 boolean add(java.lang.Object obj)
          Appends the specified element to the end of this List.
protected  boolean add(java.lang.Object obj, int state)
          Deprecated. REMOVED FROM API
protected  boolean add(java.lang.Object obj, int state, boolean processOtherSideOfAssn)
          Deprecated. REMOVED FROM API.
 boolean addAll(java.util.Collection c)
          Appends all of the elements in the specified Collection to the end of this List, in the order that they are returned by the specified Collection's Iterator.
 boolean addAll(int index, java.util.Collection c)
          Inserts all of the elements in in the specified Collection into this List at the specified position.
 void addElement(java.lang.Object obj)
          Adds the specified component to the end of this List, increasing its size by one.
 boolean contains(java.lang.Object obj)
          Tests if the specified object is a component in this List.
 boolean containsAll(java.util.Collection c)
          Returns true if this List contains all of the elements in the specified Collection.
 void copyInto(java.lang.Object[] anArray)
          Copies the components of this List into the specified array.
 void dispose()
          Clears object and all memory used by object.
 java.lang.Object elementAt(int index)
          Returns the component at the specified index.
 java.util.Enumeration elements()
          Returns an enumeration of the components of this List.
 void ensureCapacity(int minCapacity)
          Increases the capacity of this List, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
 java.lang.Object firstElement()
          Returns the first component (the item at index 0) of this List.
 void flushAll()
          Use this to empty out the list in preperation for deleting it
 java.lang.String generateAssociationAllXML(boolean fRequired, java.lang.String callingObjectID)
          Create the XML string for this association list object
 java.lang.String generateAssociationWriteXML(boolean fRequired, java.lang.String callingObjectID)
          Create the XML string for this association list object
 java.lang.String generateAssociationXML(boolean fRequired, java.lang.String callingObjectID)
          Create the XML string for this association list object
 java.lang.String generateEmptyReplaceXML()
          Generates a replacement XML String that is empty.
 java.lang.String generateObjectAndAssociationRemoveXML()
          Generates Function=Remove XML for this list
 java.lang.Object get(int index)
          Returns the element at the specified position in this List.
 java.lang.String getAssociationName()
          Gets the association Name
 java.lang.String getAssociationType()
          Gets the associationType of this association
 java.util.List<java.lang.String> getDeletedItems()
          Returns the deleted items or null if no deleted items.
 com.sas.metadata.remote.MdObjectList getInternalListObject()
           
 boolean getIsPredAssoc()
          Gets whether this is the pred side of the association or not
 boolean getIsRequired()
          Is this association required for add.
 java.lang.String getMaxCardinality()
          Get min cardinality for this association
 java.lang.String getMinCardinality()
          Get min cardinality for this association
protected  java.lang.Object getObjectforID(java.lang.String ID)
          Deprecated. REMOVED FROM API
protected  java.lang.Object getObjectforID(java.lang.String ID, boolean hashOnly)
          Deprecated. REMOVED FROM API
 java.util.Vector<java.lang.String> getObjectIDs()
          Returns the List of object ids in this list.
protected  AssociationList getOppositeAssn(java.lang.String otherID)
          Deprecated. REMOVED FROM API.
 CMetadata getParent()
          Returns the parent object of this associationlist.
 java.lang.String getProperties()
           
 int getState()
          Returns a flag that tells if the user has added or removed items.
 int hashCode()
          Returns the hash code value for this List.
 int indexOf(java.lang.Object elem)
          Searches for the first occurence of the given argument, testing for equality using the equals method.
 int indexOf(java.lang.Object elem, int index)
          Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
 void insertElementAt(java.lang.Object obj, int index)
          Inserts the specified object as a component in this List at the specified index.
 void insertElementAt(java.lang.Object obj, int index, boolean objectModified)
          Inserts the specified object as a component in this List at the specified index.
 boolean isEmpty()
          Tests if this List has no components.
 boolean isGoToServerForAssoc()
          Returns whether or not to go to the server to populate an association.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list in proper sequence.
 java.lang.Object lastElement()
          Returns the last component of the List.
 int lastIndexOf(java.lang.Object elem)
          Returns the index of the last occurrence of the specified object in this List.
 int lastIndexOf(java.lang.Object elem, int index)
          Searches backwards for the specified object, starting from the specified index, and returns an index to it.
 java.util.ListIterator listIterator()
          Returns an iterator of the elements in this list (in proper sequence).
 java.util.ListIterator listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this List.
 boolean remove(java.lang.Object o)
          Removes the first occurrence of the specified element in this List If the List does not contain the element, it is unchanged.
 boolean removeAll(java.util.Collection c)
          Removes from this List all of its elements that are contained in the specified Collection.
 void removeAllElements()
          Removes all components from this List and sets its size to zero.
 void removeAllElements(boolean objectChanged)
          Removes all components from this List and sets its size to zero.
 boolean removeElement(java.lang.Object obj)
          Removes the first (lowest-indexed) occurrence of the argument from this List.
 boolean removeElement(java.lang.Object obj, boolean processOtherSide)
          Removes the first (lowest-indexed) occurrence of the argument from this List.
 void removeElementAt(int index)
          Deletes the component at the specified index.
protected  void removeOppositeAssn(java.lang.String otherID)
          Deprecated. REMOVED FROM API.
protected  void removeRange(int fromIndex, int toIndex)
          Deprecated. REMOVED FROM API
 void resetState(int iValue)
          Removes the value from the existing state.
 void resetState(int iValue, boolean forceState)
          Removes the value from the existing state.
 boolean retainAll(java.util.Collection c)
          Retains only the elements in this List that are contained in the specified Collection.
 java.lang.Object set(int index, java.lang.Object obj)
          Replaces the element at the specified position in this List with the specified element.
 void setAssociationType(java.lang.String type)
          Sets the associationType of this association
 void setElementAt(java.lang.Object obj, int index)
          Sets the component at the specified index of this List to be the specified object.
 void setIsPredAssoc(boolean ispred)
          Sets whether this is the pred side of the association or not.
 void setObjectIDs(java.util.List<java.lang.String> newIds)
          Sets the current list to be the new list.
protected  void setOppositeAssn(java.lang.String otherID)
          Deprecated. REMOVED FROM API.
 void setParent(CMetadata inParent)
          Sets the parent object of this associationList.
 void setProperties(java.lang.String inProperties)
          Sets the properties of this association.
 void setSize(int newSize)
          Sets the size of this List.
 void setState(int iValue)
          ORs the value with the existing state.
 void setState(int iValue, boolean AddToChangeIfChanged)
          ORs the value with the existing state. depending on existing state and passed in value.
 int size()
          Returns the number of components in this List.
 java.util.List<CMetadata> subList(int fromIndex, int toIndex)
          Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this List in the correct order.
 java.lang.Object[] toArray(java.lang.Object[] a)
          Returns an array containing all of the elements in this List in the correct order.
 java.lang.String toString()
          Returns a string representation of this collection.
 void trimToSize()
          Trims the capacity of this List to be the List's current size.
 void updateObjectID(java.lang.String strOldId, java.lang.String strNewId)
          Change the hash key associated with an object, and notify listeners
 void updateOppositeSideAssn()
          Updates the opposite side assn for all object currently in list
 

Field Detail

modCount

protected transient int modCount
The number of times this list has been structurally modified. Structural modifications are those that change the size of the list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.

This field is used by the iterator and list iterator implementation returned by the iterator and listIterator methods. If the value of this field changes unexpectedly, the iterator (or list iterator) will throw a ConcurrentModificationException in response to the next, remove, previous, set or add operations. This provides fail-fast behavior, rather than non-deterministic behavior in the face of concurrent modification during iteration.

Use of this field by subclasses is optional. If a subclass wishes to provide fail-fast iterators (and list iterators), then it merely has to increment this field in its add(int, Object) and remove(int) methods (and any other methods that it overrides that result in structural modifications to the list). A single call to add(int, Object) or remove(int) must add no more than one to this field, or the iterators (and list iterators) will throw bogus ConcurrentModificationExceptions. If an implementation does not wish to provide fail-fast iterators, this field may be ignored.


list_object

protected com.sas.metadata.remote.MdObjectList list_object
This is the object used for list interactions internally.

Constructor Detail

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       int initialCapacity,
                       int capacityIncrement)
Deprecated. this constructor is no longer supported

Constructs an empty List with the specified initial capacity and capacity increment.

Parameters:
initialCapacity - the initial capacity of the List.
capacityIncrement - the amount by which the capacity is increased when the List overflows.
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

AssociationList

public AssociationList(java.lang.String strAssociationName)
Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.

Parameters:
strAssociationName - name of the associaiton

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       int initialCapacity)
Constructs an empty List with the specified initial capacity and with its capacity increment equal to zero.

Parameters:
strAssociationName - the name of the association
initialCapacity - the initial capacity of the List.
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       int initialCapacity,
                       boolean remoteEnvironment)
Constructs an empty List with the specified initial capacity and with its capacity increment equal to zero.

Parameters:
strAssociationName - the name of the association
initialCapacity - the initial capacity of the List.
remoteEnvironment - true if the client is in a remote environment
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       boolean remoteEnvironment)
Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.

Parameters:
strAssociationName - name of the associaiton
remoteEnvironment - true if the client is in a remote environment

AssociationList

public AssociationList(java.lang.String strAssociationType,
                       java.lang.String strAssociationName,
                       boolean isPredAssoc,
                       java.lang.String properties,
                       CMetadata parentObj)
Constructs an empty AssociationList with capacity 10 and the properties set accordingly.

Parameters:
strAssociationType - The type of association this is "Column-Table"
strAssociationName - The name of the association, Columns
isPredAssoc - is this a predicate side of the association.
properties - The properties of this association.
parentObj - The object this association belongs to.

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       java.lang.Object obj)
Constructs an empty List so that its internal data array has size 10 and its standard capacity increment is zero.

Parameters:
strAssociationName - String
obj - Object

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       java.util.Collection<CMetadata> c)
Constructs a List containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Parameters:
strAssociationName - The name of the association. For instance "Columns".
c - the collection whose elements are to be placed into this List.
Since:
1.2

AssociationList

public AssociationList(java.lang.String strAssociationName,
                       java.util.Collection<CMetadata> c,
                       CMetadata parentObj)
Constructs a List containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Parameters:
strAssociationName - The name of the association. For instance "Columns".
c - the collection whose elements are to be placed into this List.
parentObj - The object this association belongs to.
Since:
1.2
Method Detail

generateAssociationXML

public java.lang.String generateAssociationXML(boolean fRequired,
                                               java.lang.String callingObjectID)
Create the XML string for this association list object


generateAssociationAllXML

public java.lang.String generateAssociationAllXML(boolean fRequired,
                                                  java.lang.String callingObjectID)
Create the XML string for this association list object


generateEmptyReplaceXML

public java.lang.String generateEmptyReplaceXML()
Generates a replacement XML String that is empty.


generateAssociationWriteXML

public java.lang.String generateAssociationWriteXML(boolean fRequired,
                                                    java.lang.String callingObjectID)
Create the XML string for this association list object

Parameters:
fRequired - Is this association required for add.
callingObjectID - the ID of the object calling this method.

generateObjectAndAssociationRemoveXML

public java.lang.String generateObjectAndAssociationRemoveXML()
Generates Function=Remove XML for this list


updateObjectID

public void updateObjectID(java.lang.String strOldId,
                           java.lang.String strNewId)
Change the hash key associated with an object, and notify listeners

Parameters:
strOldId - String
strNewId - String

removeOppositeAssn

protected void removeOppositeAssn(java.lang.String otherID)
                           throws MdException,
                                  java.rmi.RemoteException
Deprecated. REMOVED FROM API.

Remove the parent object for the associationList on the other side of this association.

Parameters:
otherID - The object to get the associationList from.
Throws:
MdException
java.rmi.RemoteException

updateOppositeSideAssn

public void updateOppositeSideAssn()
Updates the opposite side assn for all object currently in list


setOppositeAssn

protected void setOppositeAssn(java.lang.String otherID)
                        throws MdException,
                               java.rmi.RemoteException
Deprecated. REMOVED FROM API.

Sets the opposite side of the association.

Throws:
MdException
java.rmi.RemoteException

getOppositeAssn

protected AssociationList getOppositeAssn(java.lang.String otherID)
                                   throws MdException,
                                          java.rmi.RemoteException
Deprecated. REMOVED FROM API.

Sets the opposite side of the association.

Throws:
MdException
java.rmi.RemoteException

getObjectIDs

public java.util.Vector<java.lang.String> getObjectIDs()
Returns the List of object ids in this list.

Returns:
List of object id strings.

setObjectIDs

public void setObjectIDs(java.util.List<java.lang.String> newIds)
Sets the current list to be the new list.

Parameters:
newIds - Vector

getParent

public CMetadata getParent()
Returns the parent object of this associationlist.

Returns:
parent

setParent

public void setParent(CMetadata inParent)
Sets the parent object of this associationList.

Parameters:
inParent - CMetadata

setProperties

public void setProperties(java.lang.String inProperties)
Sets the properties of this association. This is a string of the form:
"010101"

Parameters:
inProperties - String

getProperties

public java.lang.String getProperties()

getAssociationName

public java.lang.String getAssociationName()
Gets the association Name


getAssociationType

public java.lang.String getAssociationType()
Gets the associationType of this association

Returns:
String

setAssociationType

public void setAssociationType(java.lang.String type)
Sets the associationType of this association

Parameters:
type - String

setIsPredAssoc

public void setIsPredAssoc(boolean ispred)
Sets whether this is the pred side of the association or not.

Parameters:
ispred - boolean

getIsPredAssoc

public boolean getIsPredAssoc()
Gets whether this is the pred side of the association or not

Returns:
boolean

getMinCardinality

public java.lang.String getMinCardinality()
Get min cardinality for this association


getMaxCardinality

public java.lang.String getMaxCardinality()
Get min cardinality for this association


getIsRequired

public boolean getIsRequired()
Is this association required for add.


getDeletedItems

public java.util.List<java.lang.String> getDeletedItems()
Returns the deleted items or null if no deleted items.


getState

public int getState()
Returns a flag that tells if the user has added or removed items.


setState

public void setState(int iValue)
ORs the value with the existing state.


setState

public void setState(int iValue,
                     boolean AddToChangeIfChanged)
ORs the value with the existing state. depending on existing state and passed in value.

Parameters:
iValue - new value to set state for.
AddToChangeIfChanged - if true, add item to change list to be processed for write logic.

resetState

public void resetState(int iValue)
Removes the value from the existing state.


resetState

public void resetState(int iValue,
                       boolean forceState)
Removes the value from the existing state.

Parameters:
iValue - The value to set to, or to remove depending on forceState flag
forceState - if true, force list state to be iValue, otherwise remove iValue from state.

isGoToServerForAssoc

public boolean isGoToServerForAssoc()
Returns whether or not to go to the server to populate an association.

Returns:
boolean

setSize

public void setSize(int newSize)
Sets the size of this List. If the new size is greater than the current size, new null items are added to the end of the List. If the new size is less than the current size, all components at index newSize and greater are discarded.

Parameters:
newSize - the new size of this List.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if new size is negative.

setElementAt

public void setElementAt(java.lang.Object obj,
                         int index)
Sets the component at the specified index of this List to be the specified object. The previous component at that position is discarded.

The index must be a value greater than or equal to 0 and less than the current size of the List.

This method is identical in functionality to the set method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position.

Parameters:
obj - what the component is to be set to.
index - the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), List, set(int, java.lang.Object)

removeElementAt

public void removeElementAt(int index)
Deletes the component at the specified index. Each component in this List with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this List is decreased by 1.

The index must be a value greater than or equal to 0 and less than the current size of the List.

This method is identical in functionality to the remove method (which is part of the List interface). Note that the remove method returns the old value that was stored at the specified position.

Parameters:
index - the index of the object to remove.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), remove(int), List

insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index)
Inserts the specified object as a component in this List at the specified index. Each component in this List with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than or equal to 0 and less than or equal to the current size of the List. (If the index is equal to the current size of the List, the new element is appended to the List.)

This method is identical in functionality to the add(Object, int) method (which is part of the List interface). Note that the add method reverses the order of the parameters, to more closely match array usage.

Parameters:
obj - the component to insert.
index - where to insert the new component.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), add(int, Object), List

insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index,
                            boolean objectModified)
Inserts the specified object as a component in this List at the specified index. Each component in this List with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than or equal to 0 and less than or equal to the current size of the List. (If the index is equal to the current size of the List, the new element is appended to the List.)

This method is identical in functionality to the add(Object, int) method (which is part of the List interface). Note that the add method reverses the order of the parameters, to more closely match array usage.

Parameters:
obj - the component to insert.
index - where to insert the new component.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
size(), add(int, Object), List

addElement

public void addElement(java.lang.Object obj)
Adds the specified component to the end of this List, increasing its size by one. The capacity of this List is increased if its size becomes greater than its capacity.

This method is identical in functionality to the add(Object) method (which is part of the List interface).

Parameters:
obj - the component to be added.
See Also:
add(Object), List

removeElement

public boolean removeElement(java.lang.Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this List. If the object is found in this List, each component in the List with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.

This method is identical in functionality to the remove(Object) method (which is part of the List interface).

Parameters:
obj - the component to be removed.
Returns:
true if the argument was a component of this List; false otherwise.
See Also:
List.remove(Object), List

removeElement

public boolean removeElement(java.lang.Object obj,
                             boolean processOtherSide)
Removes the first (lowest-indexed) occurrence of the argument from this List. If the object is found in this List, each component in the List with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.

This method is identical in functionality to the remove(Object) method (which is part of the List interface).

Parameters:
obj - the component to be removed.
Returns:
true if the argument was a component of this List; false otherwise.
See Also:
List.remove(Object), List

removeAllElements

public void removeAllElements()
Removes all components from this List and sets its size to zero.

This method is identical in functionality to the clear method (which is part of the List interface).

See Also:
clear(), List

removeAllElements

public void removeAllElements(boolean objectChanged)
                       throws MdException
Removes all components from this List and sets its size to zero.

This method is identical in functionality to the clear method (which is part of the List interface).

Parameters:
objectChanged - does this remove change the containing object
Throws:
MdException
See Also:
clear(), List

set

public java.lang.Object set(int index,
                            java.lang.Object obj)
Replaces the element at the specified position in this List with the specified element.

Specified by:
set in interface java.util.List
Overrides:
set in class java.util.AbstractList
Parameters:
index - index of element to replace.
obj - object to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= size()).
java.lang.IllegalArgumentException - fromIndex > toIndex.
Since:
1.2

add

protected boolean add(java.lang.Object obj,
                      int state)
Deprecated. REMOVED FROM API

Appends the specified element to the end of this List.

Parameters:
obj - element to be appended to this List.
state - state
Returns:
true (as per the general contract of Collection.add).
Since:
1.2

add

protected boolean add(java.lang.Object obj,
                      int state,
                      boolean processOtherSideOfAssn)
Deprecated. REMOVED FROM API.

Appends the specified element to the end of this List.

Parameters:
obj - element to be appended to this List.
state - state
Returns:
true (as per the general contract of Collection.add).
Since:
1.2

add

public boolean add(java.lang.Object obj)
Appends the specified element to the end of this List.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
o - element to be appended to this List.
Returns:
true (as per the general contract of Collection.add).
Since:
1.2

remove

public boolean remove(java.lang.Object o)
Removes the first occurrence of the specified element in this List If the List does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists).

Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractCollection
Parameters:
o - element to be removed from this List, if present.
Returns:
true if the List contained the specified element.
Since:
1.2

add

public void add(int index,
                java.lang.Object element)
Inserts the specified element at the specified position in this List. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index is out of range (index < 0 || index > size()).
Since:
1.2

remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this List. shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the List.

Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractList
Parameters:
index - the index of the element to removed.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= size()).
Since:
1.2

getObjectforID

protected java.lang.Object getObjectforID(java.lang.String ID)
Deprecated. REMOVED FROM API

Get the object for and ID

Parameters:
ID - The id to get the object for recursively in parent's store.
Returns:
the object that exists in owning objects store for ID.

getObjectforID

protected java.lang.Object getObjectforID(java.lang.String ID,
                                          boolean hashOnly)
Deprecated. REMOVED FROM API

Get the object for and ID

Parameters:
ID - The id to get the object for recursively in parent's store.
use - parents map of objects to look only...not recursive.
Returns:
the object that exists in owning objects store for ID.

addAll

public boolean addAll(java.util.Collection c)
Appends all of the elements in the specified Collection to the end of this List, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this List, and this List is nonempty.)

Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractCollection
Parameters:
c - elements to be inserted into this List.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index out of range (index < 0 || index > size()).
Since:
1.2

removeAll

public boolean removeAll(java.util.Collection c)
Removes from this List all of its elements that are contained in the specified Collection.

Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.AbstractCollection
Returns:
true if this List changed as a result of the call.
Since:
1.2

retainAll

public boolean retainAll(java.util.Collection c)
Retains only the elements in this List that are contained in the specified Collection. In other words, removes from this List all of its elements that are not contained in the specified Collection.

Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Overrides:
retainAll in class java.util.AbstractCollection
Returns:
true if this List changed as a result of the call.
Since:
1.2

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Inserts all of the elements in in the specified Collection into this List at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the List in the order that they are returned by the specified Collection's iterator.

Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractList
Parameters:
index - index at which to insert first element from the specified collection.
c - elements to be inserted into this List.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index out of range (index < 0 || index > size()).
Since:
1.2

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Deprecated. REMOVED FROM API

Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the ArrayList by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

Overrides:
removeRange in class java.util.AbstractList
Parameters:
fromIndex - index of first element to be removed.
toIndex - index after last element to be removed.

flushAll

public void flushAll()
Use this to empty out the list in preperation for deleting it


iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list in proper sequence.

This implementation returns a straightforward implementation of the iterator interface, relying on the backing list's size(), get(int), and remove(int) methods.

Note that the iterator returned by this method will throw an UnsupportedOperationException in response to its remove method unless the list's remove(int) method is overridden.

This implementation can be made to throw runtime exceptions in the face of concurrent modification, as described in the specification for the (protected) modCount field.

Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List
Overrides:
iterator in class java.util.AbstractList
Returns:
an iterator over the elements in this list in proper sequence.
See Also:
modCount

listIterator

public java.util.ListIterator listIterator()
Returns an iterator of the elements in this list (in proper sequence). This implementation returns listIterator(0).

Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList
Returns:
an iterator of the elements in this list (in proper sequence).
See Also:
listIterator(int)

listIterator

public java.util.ListIterator listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to the next method. An initial call to the previous method would return the element with the specified index minus one.

This implementation returns a straightforward implementation of the ListIterator interface that extends the implementation of the Iterator interface returned by the iterator() method. The ListIterator implementation relies on the backing list's get(int), set(int, Object), add(int, Object) and remove(int) methods.

Note that the list iterator returned by this implementation will throw an UnsupportedOperationException in response to its remove, set and add methods unless the list's remove(int), set(int, Object), and add(int, Object) methods are overridden.

This implementation can be made to throw runtime exceptions in the face of concurrent modification, as described in the specification for the (protected) modCount field.

Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList
Parameters:
index - index of the first element to be returned from the list iterator (by a call to the next method).
Returns:
a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).
See Also:
modCount

contains

public boolean contains(java.lang.Object obj)
Tests if the specified object is a component in this List.

Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
Overrides:
contains in class java.util.AbstractCollection
Parameters:
elem - an object.
Returns:
true if and only if the specified object is the same as a component in this List, as determined by the equals method; false otherwise.

containsAll

public boolean containsAll(java.util.Collection c)
Returns true if this List contains all of the elements in the specified Collection.

Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List
Overrides:
containsAll in class java.util.AbstractCollection
Returns:
true if this List contains all of the elements in the specified collection.

copyInto

public void copyInto(java.lang.Object[] anArray)
Copies the components of this List into the specified array. The item at index k in this List is copied into component k of anArray. The array must be big enough to hold all the objects in this List, else an IndexOutOfBoundsException is thrown.

Parameters:
anArray - the array into which the components get copied.

dispose

public void dispose()
Clears object and all memory used by object.


elementAt

public java.lang.Object elementAt(int index)
Returns the component at the specified index.

This method is identical in functionality to the get method (which is part of the List interface).

Parameters:
index - an index into this List.
Returns:
the component at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this List object. given.
See Also:
get(int), List

elements

public java.util.Enumeration elements()
Returns an enumeration of the components of this List. The returned Enumeration object will generate all items in this List. The first item generated is the item at index 0, then the item at index 1, and so on.

Returns:
an enumeration of the components of this List.
See Also:
Enumeration, Iterator

ensureCapacity

public void ensureCapacity(int minCapacity)
Increases the capacity of this List, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.

If the current capacity of this List is less than minCapacity, then its capacity is increased by replacing its internal data array, kept in the field elementData, with a larger one. The size of the new data array will be the old size plus capacityIncrement, unless the value of capacityIncrement is less than or equal to zero, in which case the new capacity will be twice the old capacity; but if this new size is still smaller than minCapacity, then the new capacity will be minCapacity.

Parameters:
minCapacity - the desired minimum capacity.

firstElement

public java.lang.Object firstElement()
Returns the first component (the item at index 0) of this List.

Returns:
the first component of this List.
Throws:
java.util.NoSuchElementException - if this List has no components.

get

public java.lang.Object get(int index)
Returns the element at the specified position in this List.

Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList
Parameters:
index - index of element to return.
Throws:
java.lang.ArrayIndexOutOfBoundsException - index is out of range (index < 0 || index >= size()).
Since:
1.2

hashCode

public int hashCode()
Returns the hash code value for this List.

Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.util.AbstractList

indexOf

public int indexOf(java.lang.Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.

Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class java.util.AbstractList
Parameters:
elem - an object.
Returns:
the index of the first occurrence of the argument in this List, that is, the smallest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found.
See Also:
Object.equals(Object)

indexOf

public int indexOf(java.lang.Object elem,
                   int index)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.

Parameters:
elem - an object.
index - the non-negative index to start searching from.
Returns:
the index of the first occurrence of the object argument in this List at position index or later in the List, that is, the smallest value k such that elem.equals(elementData[k]) && (k >= index) is true; returns -1 if the object is not found. (Returns -1 if index >= the current size of this List.)
Throws:
java.lang.IndexOutOfBoundsException - if index is negative.
See Also:
Object.equals(Object)

isEmpty

public boolean isEmpty()
Tests if this List has no components.

Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class java.util.AbstractCollection
Returns:
true if and only if this List has no components, that is, its size is zero; false otherwise.

lastElement

public java.lang.Object lastElement()
Returns the last component of the List.

Returns:
the last component of the List, i.e., the component at index size() - 1.
Throws:
java.util.NoSuchElementException - if this List is empty.

lastIndexOf

public int lastIndexOf(java.lang.Object elem)
Returns the index of the last occurrence of the specified object in this List.

Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class java.util.AbstractList
Parameters:
elem - the desired component.
Returns:
the index of the last occurrence of the specified object in this List, that is, the largest value k such that elem.equals(elementData[k]) is true; returns -1 if the object is not found.

lastIndexOf

public int lastIndexOf(java.lang.Object elem,
                       int index)
Searches backwards for the specified object, starting from the specified index, and returns an index to it.

Parameters:
elem - the desired component.
index - the index to start searching from.
Returns:
the index of the last occurrence of the specified object in this List at position less than or equal to index in the List, that is, the largest value k such that elem.equals(elementData[k]) && (k <= index) is true; -1 if the object is not found. (Returns -1 if index is negative.)
Throws:
java.lang.IndexOutOfBoundsException - if index is greater than or equal to the current size of this List.

size

public int size()
Returns the number of components in this List.

Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection
Returns:
the number of components in this List.

subList

public java.util.List<CMetadata> subList(int fromIndex,
                                         int toIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and ToIndex are equal, the returned List is empty.) The returned List is backed by this List, so changes in the returned List are reflected in this List, and vice-versa. The returned List supports all of the optional List operations supported by this List.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a List can be used as a range operation by operating on a subList view instead of a whole List. For example, the following idiom removes a range of elements from a List:

            list.subList(from, to).clear();
 
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the List returned by this method become undefined if the backing list (i.e., this List) is structurally modified in any way other than via the returned List. (Structural modifications are those that change the size of the List, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Specified by:
subList in interface java.util.List
Overrides:
subList in class java.util.AbstractList
Parameters:
fromIndex - low endpoint (inclusive) of the subList.
toIndex - high endpoint (exclusive) of the subList.
Returns:
a view of the specified range within this List.
Throws:
java.lang.IndexOutOfBoundsException - endpoint index value out of range (fromIndex < 0 || toIndex > size)
java.lang.IllegalArgumentException - endpoint indices out of order (fromIndex > toIndex)

toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this List in the correct order.

Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection
Since:
1.2

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this List in the correct order. The runtime type of the returned array is that of the specified array. If the List fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this List.

If the List fits in the specified array with room to spare (i.e., the array has more elements than the List), the element in the array immediately following the end of the List is set to null. This is useful in determining the length of the List only if the caller knows that the List does not contain any null elements.

Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection
Parameters:
a - the array into which the elements of the List are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the List.
Throws:
java.lang.ArrayStoreException - the runtime type of a is not a supertype
java.lang.RuntimeException - is thrown if RemoteException is encountered(RemoteException is chained) of the runtime type of every element in this List.

toString

public java.lang.String toString()
Returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String.valueOf(Object).

This implementation creates an empty string buffer, appends a left square bracket, and iterates over the collection appending the string representation of each element in turn. After appending each element except the last, the string ", " is appended. Finally a right bracket is appended. A string is obtained from the string buffer, and returned.

Overrides:
toString in class java.util.AbstractCollection
Returns:
a string representation of this collection.

trimToSize

public void trimToSize()
Trims the capacity of this List to be the List's current size. If the capacity of this cector is larger than its current size, then the capacity is changed to equal the size by replacing its internal data array, kept in the field elementData, with a smaller one. An application can use this operation to minimize the storage of a List.


getInternalListObject

public com.sas.metadata.remote.MdObjectList getInternalListObject()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.