public class ListStructure extends Structure implements java.util.List
HashStructure
. Instances of ListStructure can be contained
in HashStructure and vice versa. ListStructure may also contain
other instances of ListStructure.
Supported Types
The only types of objects that may be added to ListStructure are
the same types that are supported by HashStructure:
java.lang.String
java.lang.Boolean
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.net.URL
oracle.javatools.data.HashStructure
oracle.javatools.data.ListStructure
List
interface. This class may
be enhanced in the future to implement the List interface
completely.Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object obj)
Adds the specified object to this ListStructure at the specified
index.
|
boolean |
add(java.lang.Object obj)
Adds the specified object to the end of this ListStructure.
|
boolean |
addAll(java.util.Collection coll)
Adds all of the objects in the specified
Collection to the
end of this ListStructure. |
boolean |
addAll(int index,
java.util.Collection coll)
Adds all of the objects in the specified
Collection to this
ListStructure at the specified index. |
boolean |
addPlaceholder(java.lang.Object obj)
Adds the specified object to the end of this ListStructure as
a placeholder value.
|
void |
clear()
Removes all objects from this ListStructure.
|
boolean |
contains(java.lang.Object obj)
Returns
true if this ListStructure contains the
specified object; false otherwise. |
boolean |
containsAll(java.util.Collection coll)
Returns
true if this ListStructure contains all of the
objects in the specified Collection ; false
otherwise. |
ListStructure |
copyTo(ListStructure dest) |
boolean |
equals(java.lang.Object obj) |
protected boolean |
equalsImpl(ListStructure other) |
java.lang.Object |
get(int index)
Returns the object located at the specified index.
|
int |
hashCode() |
int |
indexOf(java.lang.Object obj)
Returns the index of the specified object in this ListStructure.
|
void |
internalPreprsist()
Do not use this method.
|
boolean |
isEmpty()
Returns
true if the ListStructure currently contains
zero items; false otherwise. |
java.util.Iterator |
iterator()
Returns an
Iterator over the current ListStructure. |
java.lang.Object |
iteratorLock()
Returns the object on which callers must lock when using the
iterator() method on this class. |
int |
lastIndexOf(java.lang.Object obj)
Returns the index of the last occurrence of the specified object
in this ListStructure.
|
java.util.ListIterator |
listIterator()
Currently throws
UnsupportedOperationException . |
java.util.ListIterator |
listIterator(int i)
Currently throws
UnsupportedOperationException . |
boolean |
mirror(java.util.List list)
Sets this ListStructure to mirror the contents of the specified List.
|
static ListStructure |
newInstance() |
java.lang.Object |
remove(int index)
Removes the object at the specified index from this ListStructure,
returning the object removed.
|
boolean |
remove(java.lang.Object obj)
Removes the first occurrence of the specified object from this
ListStructure.
|
boolean |
removeAll(java.util.Collection coll)
Removes all of the objects in the specified
Collection
from this ListStructure. |
boolean |
retainAll(java.util.Collection coll)
Removes all items from this ListStructure except for the ones in
the specified
Collection . |
java.lang.Object |
set(int index,
java.lang.Object newValue)
Replaces the object at the specified index with the specified new
value.
|
int |
size()
Returns the number of items currently contained in this
ListStructure.
|
java.util.List |
subList(int i,
int j)
Currently throws
UnsupportedOperationException . |
java.lang.Object[] |
toArray()
Returns the contents of this ListStructure as an Object array.
|
java.lang.Object[] |
toArray(java.lang.Object[] array)
Copies the contents of this ListStructure into the specified
array.
|
addStructureChangeListener, applyBatchChanges, getFullName, getStructName, intern, intern, intern, isDirty, markDirty, removeStructureChangeListener
public static final ListStructure newInstance()
public void add(int index, java.lang.Object obj)
add
in interface java.util.List
java.lang.IllegalArgumentException
- if the object is not one of the
supported typesjava.lang.IndexOutOfBoundsException
- if the specified index is out
of range for the current ListStructure.public boolean add(java.lang.Object obj)
add
in interface java.util.Collection
add
in interface java.util.List
java.lang.IllegalArgumentException
- if the object is not one of the
supported typespublic boolean addPlaceholder(java.lang.Object obj)
HashStructure#placeholder
for
more details on placeholder value. The ListStructure does not
become dirty from calling addPlaceholder.java.lang.IllegalArgumentException
- if the object is not one of the
supported typespublic boolean addAll(int index, java.util.Collection coll)
Collection
to this
ListStructure at the specified index.addAll
in interface java.util.List
java.lang.IllegalArgumentException
- if any object in the Collection is
not one of the supported typesjava.lang.IndexOutOfBoundsException
- if the specified index is out
of range for the current ListStructure.public boolean addAll(java.util.Collection coll)
Collection
to the
end of this ListStructure.addAll
in interface java.util.Collection
addAll
in interface java.util.List
java.lang.IllegalArgumentException
- if any object in the Collection is
not one of the supported typespublic void clear()
public boolean contains(java.lang.Object obj)
true
if this ListStructure contains the
specified object; false
otherwise.contains
in interface java.util.Collection
contains
in interface java.util.List
public boolean containsAll(java.util.Collection coll)
true
if this ListStructure contains all of the
objects in the specified Collection
; false
otherwise.containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
public java.lang.Object get(int index)
get
in interface java.util.List
java.lang.IndexOutOfBoundsException
- if the specified index is out
of range for the current ListStructure.public int indexOf(java.lang.Object obj)
indexOf
in interface java.util.List
public boolean isEmpty()
true
if the ListStructure currently contains
zero items; false
otherwise.isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
public java.lang.Object iteratorLock()
iterator()
method on this class.iterator()
method on this class.public java.util.Iterator iterator()
Iterator
over the current ListStructure.
The returned Iterator supports the remove method.
Thread safety: Callers must lock the list while iterating.
Do this as follows:
synchronized ( ls.iteratorLock() ) { for ( Iterator i = ls.iterator(); i.hasNext(); ) { // .... } }
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
public int lastIndexOf(java.lang.Object obj)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
UnsupportedOperationException
.listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int i)
UnsupportedOperationException
.listIterator
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
java.lang.IndexOutOfBoundsException
- if the specified index is out
of range for the current ListStructure.public boolean remove(java.lang.Object obj)
true
if the removal occurred,
false
otherwise.remove
in interface java.util.Collection
remove
in interface java.util.List
public boolean removeAll(java.util.Collection coll)
Collection
from this ListStructure. Returns true
if any
item was removed (not necessarily all items); false
otherwise.removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
public boolean retainAll(java.util.Collection coll)
Collection
. Returns true
if
any items (possibly all items) were removed; false
otherwise.retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object newValue)
set
in interface java.util.List
java.lang.IllegalArgumentException
- if the object is not one of the
supported typesjava.lang.IndexOutOfBoundsException
- if the specified index is out
of range for the current ListStructure.public java.util.List subList(int i, int j)
UnsupportedOperationException
.subList
in interface java.util.List
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] array)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public boolean mirror(java.util.List list)
public void internalPreprsist()
public ListStructure copyTo(ListStructure dest)
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in class java.lang.Object
protected boolean equalsImpl(ListStructure other)
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.lang.Object