Package ch.ivyteam.ivy.scripting.objects
Class List<E>
java.lang.Object
ch.ivyteam.ivy.scripting.objects.NestedObject
ch.ivyteam.ivy.scripting.objects.List<E>
- Type Parameters:
E
- The type of List-members.soap
- All Implemented Interfaces:
IIvyDataObject
,Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,List<E>
A class for typed lists. A typed List knows its member type at runtime
(for use in IvyScript). For use in Java-context, the class is generic.
- Since:
- March 2006
- See Also:
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts a new element into the list.boolean
Adds an element to the list.boolean
addAll
(int index, Collection<? extends E> elements) Inserts all elemnts of some collection into this list.boolean
addAll
(Collection<? extends E> elements) Adds all elements of a collection to this list.void
clear()
clone()
Returns a shallow copy of this List.boolean
boolean
containsAll
(Collection<?> c) create()
Creates a list for arbitrary IvyObjects.create
(int initCap) Creates a list for arbitrary IvyObjects.static <C> List<C>
Creates a List with given Java-Member type.static <C> List<C>
Creates a List with given Java-Member type.Returns a deep copy of this List.void
elementChanged
(Object object) Notifies all listeners that the given object has changed.void
elementChangedAt
(int index) Notifies all listeners that the element at given index has changed.void
ensureCapacity
(int cap) Sets the capacity of the list.get
(int index) (package private) int
hashCode
(int level) Computes a hashcode considering elements up to a certain nesting depth.int
boolean
isEmpty()
iterator()
int
listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) Sets the value of a list element.int
size()
subList
(int fromIndex, int toIndex) E[]
toArray()
<T> T[]
toArray
(T[] a) void
Trims the wrapped array.Methods inherited from class ch.ivyteam.ivy.scripting.objects.NestedObject
equals, hashCode, toString
-
Method Details
-
create
Creates a list for arbitrary IvyObjects.- Returns:
- created list
- API:
- This public API is available in Java.
-
create
Creates a List with given Java-Member type.- Type Parameters:
C
-- Parameters:
javaClass
-- Returns:
- created list
- API:
- This public API is available in Java.
-
create
Creates a list for arbitrary IvyObjects.- Parameters:
initCap
-- Returns:
- created list
- API:
- This public API is available in Java.
-
create
Creates a List with given Java-Member type.- Type Parameters:
C
-- Parameters:
javaClass
-initCap
-- Returns:
- created list
- API:
- This public API is available in Java.
-
add
Adds an element to the list.- Parameters:
element
- The new element.- Returns:
- Always return true.
- API:
- This public API is available in Java.
-
add
Inserts a new element into the list.- Parameters:
index
- Where to insert the new element.element
- The new Element.- API:
- This public API is available in Java.
-
addAll
Adds all elements of a collection to this list.- Parameters:
elements
- A collection with new elements; may be null.- Returns:
- true if this list changed as a result of the call.
- API:
- This public API is available in Java.
-
addAll
Inserts all elemnts of some collection into this list.- Parameters:
index
- Where to insert the new elements.elements
- A collection with new elements.- Returns:
- true if this list changed as a result of the call.
- API:
- This public API is available in Java.
-
set
Sets the value of a list element.- Parameters:
index
- The index of the element to set.element
- The new value.- Returns:
- The element previously at the specified position.
- API:
- This public API is available in Java.
-
elementChangedAt
public void elementChangedAt(int index) Notifies all listeners that the element at given index has changed.- Parameters:
index
-- API:
- This public API is available in Java.
-
elementChanged
Notifies all listeners that the given object has changed.- Parameters:
object
-- API:
- This public API is available in Java.
-
contains
- See Also:
- API:
- This public API is available in Java.
-
containsAll
- See Also:
- API:
- This public API is available in Java.
-
get
- See Also:
- API:
- This public API is available in Java.
-
indexOf
- See Also:
- API:
- This public API is available in Java.
-
isEmpty
public boolean isEmpty()- See Also:
- API:
- This public API is available in Java.
-
iterator
- See Also:
- API:
- This public API is available in Java.
-
lastIndexOf
- See Also:
- API:
- This public API is available in Java.
-
listIterator
- See Also:
- API:
- This public API is available in Java.
-
listIterator
- See Also:
- API:
- This public API is available in Java.
-
remove
- See Also:
- API:
- This public API is available in Java.
-
remove
- See Also:
- API:
- This public API is available in Java.
-
removeAll
- See Also:
- API:
- This public API is available in Java.
-
retainAll
- See Also:
- API:
- This public API is available in Java.
-
subList
- See Also:
- API:
- This public API is available in Java.
-
toArray
- See Also:
- API:
- This public API is available in Java.
-
toArray
public <T> T[] toArray(T[] a) - Type Parameters:
T
- The type of the argument array- Parameters:
a
-- Returns:
- array with list contents
- API:
- This public API is available in Java.
-
clear
public void clear()- See Also:
- API:
- This public API is available in Java.
-
size
public int size()- See Also:
- API:
- This public API is available in Java.
-
ensureCapacity
public void ensureCapacity(int cap) Sets the capacity of the list.- Parameters:
cap
-- API:
- This public API is available in Java.
-
clone
Returns a shallow copy of this List.- Specified by:
clone
in interfaceIIvyDataObject
- Overrides:
clone
in classNestedObject
- Returns:
- A clone
- See Also:
- API:
- This public API is available in Java.
-
deepClone
Returns a deep copy of this List.- Specified by:
deepClone
in interfaceIIvyDataObject
- Overrides:
deepClone
in classNestedObject
- Returns:
- A clone
- API:
- This public API is available in Java.
-
hashCode
int hashCode(int level) Computes a hashcode considering elements up to a certain nesting depth.- Parameters:
level
- The nesting depth.- Returns:
- a HashCode
- API:
- This public API is available in Java.
-
trimToSize
public void trimToSize()Trims the wrapped array.- API:
- This public API is available in Java.
-