|
Metadata |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.metadata.remote.AssociationList
public class AssociationList
Extension of List to manage associations between objects.
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 |
---|
protected transient int modCount
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.
protected com.sas.metadata.remote.MdObjectList list_object
Constructor Detail |
---|
public AssociationList(java.lang.String strAssociationName, int initialCapacity, int capacityIncrement)
initialCapacity
- the initial capacity of the List.capacityIncrement
- the amount by which the capacity is
increased when the List overflows.
java.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic AssociationList(java.lang.String strAssociationName)
strAssociationName
- name of the associaitonpublic AssociationList(java.lang.String strAssociationName, int initialCapacity)
strAssociationName
- the name of the associationinitialCapacity
- the initial capacity of the List.
java.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic AssociationList(java.lang.String strAssociationName, int initialCapacity, boolean remoteEnvironment)
strAssociationName
- the name of the associationinitialCapacity
- the initial capacity of the List.remoteEnvironment
- true if the client is in a remote environment
java.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic AssociationList(java.lang.String strAssociationName, boolean remoteEnvironment)
strAssociationName
- name of the associaitonremoteEnvironment
- true if the client is in a remote environmentpublic AssociationList(java.lang.String strAssociationType, java.lang.String strAssociationName, boolean isPredAssoc, java.lang.String properties, CMetadata parentObj)
strAssociationType
- The type of association this is "Column-Table"strAssociationName
- The name of the association, ColumnsisPredAssoc
- is this a predicate side of the association.properties
- The properties of this association.parentObj
- The object this association belongs to.public AssociationList(java.lang.String strAssociationName, java.lang.Object obj)
strAssociationName
- Stringobj
- Objectpublic AssociationList(java.lang.String strAssociationName, java.util.Collection<CMetadata> c)
strAssociationName
- The name of the association. For instance "Columns".c
- the collection whose elements are to be placed into this List.public AssociationList(java.lang.String strAssociationName, java.util.Collection<CMetadata> c, CMetadata parentObj)
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.Method Detail |
---|
public java.lang.String generateAssociationXML(boolean fRequired, java.lang.String callingObjectID)
public java.lang.String generateAssociationAllXML(boolean fRequired, java.lang.String callingObjectID)
public java.lang.String generateEmptyReplaceXML()
public java.lang.String generateAssociationWriteXML(boolean fRequired, java.lang.String callingObjectID)
fRequired
- Is this association required for add.callingObjectID
- the ID of the object calling this method.public java.lang.String generateObjectAndAssociationRemoveXML()
public void updateObjectID(java.lang.String strOldId, java.lang.String strNewId)
strOldId
- StringstrNewId
- Stringprotected void removeOppositeAssn(java.lang.String otherID) throws MdException, java.rmi.RemoteException
otherID
- The object to get the associationList from.
MdException
java.rmi.RemoteException
public void updateOppositeSideAssn()
protected void setOppositeAssn(java.lang.String otherID) throws MdException, java.rmi.RemoteException
MdException
java.rmi.RemoteException
protected AssociationList getOppositeAssn(java.lang.String otherID) throws MdException, java.rmi.RemoteException
MdException
java.rmi.RemoteException
public java.util.Vector<java.lang.String> getObjectIDs()
public void setObjectIDs(java.util.List<java.lang.String> newIds)
newIds
- Vectorpublic CMetadata getParent()
public void setParent(CMetadata inParent)
inParent
- CMetadatapublic void setProperties(java.lang.String inProperties)
inProperties
- Stringpublic java.lang.String getProperties()
public java.lang.String getAssociationName()
public java.lang.String getAssociationType()
public void setAssociationType(java.lang.String type)
type
- Stringpublic void setIsPredAssoc(boolean ispred)
ispred
- booleanpublic boolean getIsPredAssoc()
public java.lang.String getMinCardinality()
public java.lang.String getMaxCardinality()
public boolean getIsRequired()
public java.util.List<java.lang.String> getDeletedItems()
public int getState()
public void setState(int iValue)
public void setState(int iValue, boolean AddToChangeIfChanged)
iValue
- new value to set state for.AddToChangeIfChanged
- if true, add item to change list to be processed for write logic.public void resetState(int iValue)
public void resetState(int iValue, boolean forceState)
iValue
- The value to set to, or to remove depending on forceState flagforceState
- if true, force list state to be iValue, otherwise remove iValue from state.public boolean isGoToServerForAssoc()
public void setSize(int newSize)
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.
newSize
- the new size of this List.
java.lang.ArrayIndexOutOfBoundsException
- if new size is negative.public void setElementAt(java.lang.Object obj, int index)
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.
obj
- what the component is to be set to.index
- the specified index.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.size()
,
List
,
set(int, java.lang.Object)
public void removeElementAt(int index)
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.
index
- the index of the object to remove.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.size()
,
remove(int)
,
List
public void insertElementAt(java.lang.Object obj, int index)
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.
obj
- the component to insert.index
- where to insert the new component.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.size()
,
add(int, Object)
,
List
public void insertElementAt(java.lang.Object obj, int index, boolean objectModified)
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.
obj
- the component to insert.index
- where to insert the new component.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.size()
,
add(int, Object)
,
List
public void addElement(java.lang.Object obj)
This method is identical in functionality to the add(Object) method (which is part of the List interface).
obj
- the component to be added.add(Object)
,
List
public boolean removeElement(java.lang.Object obj)
This method is identical in functionality to the remove(Object) method (which is part of the List interface).
obj
- the component to be removed.
true
if the argument was a component of this
List; false
otherwise.List.remove(Object)
,
List
public boolean removeElement(java.lang.Object obj, boolean processOtherSide)
This method is identical in functionality to the remove(Object) method (which is part of the List interface).
obj
- the component to be removed.
true
if the argument was a component of this
List; false
otherwise.List.remove(Object)
,
List
public void removeAllElements()
This method is identical in functionality to the clear method (which is part of the List interface).
clear()
,
List
public void removeAllElements(boolean objectChanged) throws MdException
This method is identical in functionality to the clear method (which is part of the List interface).
objectChanged
- does this remove change the containing object
MdException
clear()
,
List
public java.lang.Object set(int index, java.lang.Object obj)
set
in interface java.util.List
set
in class java.util.AbstractList
index
- index of element to replace.obj
- object to be stored at the specified position.
java.lang.ArrayIndexOutOfBoundsException
- index out of range
(index < 0 || index >= size()).
java.lang.IllegalArgumentException
- fromIndex > toIndex.protected boolean add(java.lang.Object obj, int state)
obj
- element to be appended to this List.state
- state
protected boolean add(java.lang.Object obj, int state, boolean processOtherSideOfAssn)
obj
- element to be appended to this List.state
- state
public boolean add(java.lang.Object obj)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.AbstractList
o
- element to be appended to this List.
public boolean remove(java.lang.Object o)
(o==null ? get(i)==null : o.equals(get(i)))
(if such
an element exists).
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.AbstractCollection
o
- element to be removed from this List, if present.
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.AbstractList
index
- index at which the specified element is to be inserted.element
- element to be inserted.
java.lang.ArrayIndexOutOfBoundsException
- index is out of range
(index < 0 || index > size()).public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.AbstractList
index
- the index of the element to removed.
java.lang.ArrayIndexOutOfBoundsException
- index out of range (index
< 0 || index >= size()).protected java.lang.Object getObjectforID(java.lang.String ID)
ID
- The id to get the object for recursively in parent's store.
protected java.lang.Object getObjectforID(java.lang.String ID, boolean hashOnly)
ID
- The id to get the object for recursively in parent's store.use
- parents map of objects to look only...not recursive.
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.AbstractCollection
c
- elements to be inserted into this List.
java.lang.ArrayIndexOutOfBoundsException
- index out of range (index
< 0 || index > size()).public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.AbstractCollection
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.AbstractCollection
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.AbstractList
index
- index at which to insert first element
from the specified collection.c
- elements to be inserted into this List.
java.lang.ArrayIndexOutOfBoundsException
- index out of range (index
< 0 || index > size()).protected void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.AbstractList
fromIndex
- index of first element to be removed.toIndex
- index after last element to be removed.public void flushAll()
public java.util.Iterator iterator()
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.
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
iterator
in class java.util.AbstractList
modCount
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractList
listIterator(int)
public java.util.ListIterator listIterator(int index)
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.
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractList
index
- index of the first element to be returned from the list
iterator (by a call to the next method).
java.lang.IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index > size()).modCount
public boolean contains(java.lang.Object obj)
contains
in interface java.util.Collection
contains
in interface java.util.List
contains
in class java.util.AbstractCollection
elem
- an object.
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.public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
containsAll
in class java.util.AbstractCollection
public void copyInto(java.lang.Object[] anArray)
anArray
- the array into which the components get copied.public void dispose()
public java.lang.Object elementAt(int index)
This method is identical in functionality to the get method (which is part of the List interface).
index
- an index into this List.
java.lang.ArrayIndexOutOfBoundsException
- if the index
is negative or not less than the current size of this
List object.
given.get(int)
,
List
public java.util.Enumeration elements()
Enumeration
,
Iterator
public void ensureCapacity(int minCapacity)
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.
minCapacity
- the desired minimum capacity.public java.lang.Object firstElement()
java.util.NoSuchElementException
- if this List has no components.public java.lang.Object get(int index)
get
in interface java.util.List
get
in class java.util.AbstractList
index
- index of element to return.
java.lang.ArrayIndexOutOfBoundsException
- index is out of range (index
< 0 || index >= size()).public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.util.AbstractList
public int indexOf(java.lang.Object elem)
equals
method.
indexOf
in interface java.util.List
indexOf
in class java.util.AbstractList
elem
- an object.
-1
if the object is not found.Object.equals(Object)
public int indexOf(java.lang.Object elem, int index)
index
, and testing for equality using
the equals
method.
elem
- an object.index
- the non-negative index to start searching from.
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.)
java.lang.IndexOutOfBoundsException
- if index is negative.Object.equals(Object)
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
isEmpty
in class java.util.AbstractCollection
true
if and only if this List has
no components, that is, its size is zero;
false
otherwise.public java.lang.Object lastElement()
size() - 1
.
java.util.NoSuchElementException
- if this List is empty.public int lastIndexOf(java.lang.Object elem)
lastIndexOf
in interface java.util.List
lastIndexOf
in class java.util.AbstractList
elem
- the desired component.
-1
if the object is not found.public int lastIndexOf(java.lang.Object elem, int index)
elem
- the desired component.index
- the index to start searching from.
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.)
java.lang.IndexOutOfBoundsException
- if index is greater
than or equal to the current size of this List.public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
public java.util.List<CMetadata> subList(int fromIndex, int toIndex)
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.)
subList
in interface java.util.List
subList
in class java.util.AbstractList
fromIndex
- low endpoint (inclusive) of the subList.toIndex
- high endpoint (exclusive) of the subList.
java.lang.IndexOutOfBoundsException
- endpoint index value out of range
(fromIndex < 0 || toIndex > size)
java.lang.IllegalArgumentException
- endpoint indices out of order
(fromIndex > toIndex)
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
public java.lang.Object[] toArray(java.lang.Object[] a)
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.
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
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.
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.public java.lang.String toString()
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.
toString
in class java.util.AbstractCollection
public void trimToSize()
public com.sas.metadata.remote.MdObjectList getInternalListObject()
|
Metadata |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |