Package com.luciad.util.collections
Class TLcdArrayList<T>
java.lang.Object
com.luciad.util.collections.TLcdArrayList<T>
- All Implemented Interfaces:
ILcdCollection<T>
,ILcdList<T>
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
- Since:
- 9.1
-
Constructor Summary
ConstructorDescriptionConstructs an empty list with an initial capacity of ten.TLcdArrayList
(int aInitialCapacity) Constructs an empty list with the specified initial capacity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method behaves the same asILcdList.add(int, Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.boolean
This method behaves the same asILcdCollection.add(Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.boolean
addAll
(int aIndex, Collection<? extends T> aCollection, int aFireEventMode) This method behaves the same asILcdList.addAll(int, Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.boolean
addAll
(Collection<? extends T> aCollection, int aFireEventMode) This method behaves the same asILcdCollection.addAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.void
addCollectionListener
(ILcdCollectionListener<T> aCollectionListener) Register the listeneraCollectionListener
to be informed about changes in this collection.void
addListListener
(ILcdListListener<T> aListListener) Register the listeneraListListener
to be informed about changes in this list.void
clear
(int aFireEventMode) This method behaves the same asILcdCollection.clear()
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.clone()
Returns a shallow copy of this TLcdArrayList instance.boolean
boolean
containsAll
(Collection<?> aCollection) boolean
void
Fires all the collected change events from modifications performed with theILcdFireEventMode.FIRE_LATER
fire event mode.get
(int aIndex) int
hashCode()
int
boolean
isEmpty()
iterator()
int
lastIndexOf
(Object aObject) listIterator
(int aIndex) remove
(int aIndex, int aFireEventMode) This method behaves the same asILcdList.remove(int)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.boolean
This method behaves the same asILcdCollection.remove(Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.boolean
removeAll
(Collection<?> aCollection, int aFireEventMode) This method behaves the same asILcdCollection.removeAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.void
removeCollectionListener
(ILcdCollectionListener<T> aCollectionListener) Unregister the listeneraCollectionListener
so it will no longer be informed about changes in this collection.void
removeListListener
(ILcdListListener<T> aListListener) Unregister the listeneraListListener
so it will no longer be informed about changes in this collection.boolean
retainAll
(Collection<?> aCollection, int aFireEventMode) This method behaves the same asILcdCollection.retainAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.This method behaves the same asILcdList.set(int, Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call.int
size()
subList
(int aFromIndex, int aToIndex) Object[]
toArray()
<U> U[]
toArray
(U[] aArray) toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface com.luciad.util.collections.ILcdList
add, add, addAll, addAll, clear, remove, remove, removeAll, retainAll, set
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
TLcdArrayList
public TLcdArrayList()Constructs an empty list with an initial capacity of ten. -
TLcdArrayList
public TLcdArrayList(int aInitialCapacity) Constructs an empty list with the specified initial capacity.- Parameters:
aInitialCapacity
- the initial capacity of the list- Throws:
IllegalArgumentException
- if the specified initial capacity is negative
-
-
Method Details
-
set
Description copied from interface:ILcdList
This method behaves the same asILcdList.set(int, Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the list is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
set
in interfaceILcdList<T>
- Parameters:
aIndex
- index of the element to replace.aElement
- element to be stored at the specified position.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- the element previously at the specified position
- See Also:
-
add
Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.add(Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
add
in interfaceILcdCollection<T>
- Parameters:
aElement
- element whose presence in this collection is to be ensured.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if this collection changed as a result of the call
- See Also:
-
add
Description copied from interface:ILcdList
This method behaves the same asILcdList.add(int, Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the list is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
add
in interfaceILcdList<T>
- Parameters:
aIndex
- index at which the specified element is to be inserted.aElement
- element to be inserted.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- See Also:
-
remove
Description copied from interface:ILcdList
This method behaves the same asILcdList.remove(int)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the list is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
remove
in interfaceILcdList<T>
- Parameters:
aIndex
- the index of the element to be removed.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- the element previously at the specified position
- See Also:
-
remove
Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.remove(Object)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
remove
in interfaceILcdCollection<T>
- Parameters:
aObject
- element to be removed from this collection, if present.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if an element was removed as a result of this call
- See Also:
-
clear
public void clear(int aFireEventMode) Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.clear()
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
clear
in interfaceILcdCollection<T>
- Parameters:
aFireEventMode
- theILcdFireEventMode
for sending out the change event.- See Also:
-
addAll
Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.addAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
addAll
in interfaceILcdCollection<T>
- Parameters:
aCollection
- collection containing elements to be added to this collection.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if this collection changed as a result of the call
- See Also:
-
addAll
Description copied from interface:ILcdList
This method behaves the same asILcdList.addAll(int, Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the list is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
addAll
in interfaceILcdList<T>
- Parameters:
aIndex
- index at which to insert the first element from the specified collection.aCollection
- collection containing elements to be added to this list.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if this list changed as a result of the call
- See Also:
-
removeAll
Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.removeAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
removeAll
in interfaceILcdCollection<T>
- Parameters:
aCollection
- collection containing elements to be removed from this collection.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if this collection changed as a result of the call
- See Also:
-
retainAll
Description copied from interface:ILcdCollection
This method behaves the same asILcdCollection.retainAll(Collection)
, but additionally accepts anILcdFireEventMode
parameter that allows to postpone firing change events resulting from this method call. WhenILcdFireEventMode.FIRE_LATER
is passed, any change events are temporarily stored and only fired onceILcdCollection.fireCollectedChanges()
is called. This is useful for example when the collection is protected by a read/write lock, in order to avoid potential deadlocks down the line. See theclass javadoc
for an example code snippet.- Specified by:
retainAll
in interfaceILcdCollection<T>
- Parameters:
aCollection
- collection containing elements to be retained in this collection.aFireEventMode
- theILcdFireEventMode
for sending out the change event.- Returns:
- true if this collection changed as a result of the call
- See Also:
-
fireCollectedChanges
public void fireCollectedChanges()Description copied from interface:ILcdCollection
Fires all the collected change events from modifications performed with theILcdFireEventMode.FIRE_LATER
fire event mode.- Specified by:
fireCollectedChanges
in interfaceILcdCollection<T>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
-
toArray
-
toArray
public <U> U[] toArray(U[] aArray) -
get
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
subList
-
equals
-
hashCode
public int hashCode() -
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
toString
-
addListListener
Description copied from interface:ILcdList
Register the listener
aListListener
to be informed about changes in this list.- Specified by:
addListListener
in interfaceILcdList<T>
- Parameters:
aListListener
- the listener- See Also:
-
removeListListener
Description copied from interface:ILcdList
Unregister the listener
aListListener
so it will no longer be informed about changes in this collection.This method should do nothing when
aListListener
was not registered previously.- Specified by:
removeListListener
in interfaceILcdList<T>
- Parameters:
aListListener
- the listener- See Also:
-
addCollectionListener
Description copied from interface:ILcdCollection
Register the listener
aCollectionListener
to be informed about changes in this collection.- Specified by:
addCollectionListener
in interfaceILcdCollection<T>
- Parameters:
aCollectionListener
- the listener- See Also:
-
removeCollectionListener
Description copied from interface:ILcdCollection
Unregister the listener
aCollectionListener
so it will no longer be informed about changes in this collection.This method should do nothing when
aCollectionListener
was not registered previously.- Specified by:
removeCollectionListener
in interfaceILcdCollection<T>
- Parameters:
aCollectionListener
- the listener- See Also:
-
clone
Returns a shallow copy of this TLcdArrayList instance. (The elements themselves are not copied.). The returned list will have no listeners attached to it.
-