public class Sequence extends java.util.ArrayList implements GroovyObject
Constructor and Description |
---|
Sequence() |
Sequence(java.lang.Class type) |
Sequence(java.lang.Class type,
java.util.List content) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object element) |
boolean |
add(java.lang.Object element) |
boolean |
addAll(java.util.Collection c) |
boolean |
addAll(int index,
java.util.Collection c) |
protected void |
checkCollectionType(java.util.Collection c)
Checks that each member of the given collection are of the correct
type
|
protected void |
checkType(java.lang.Object object)
Checks that the given object instance is of the correct type
otherwise a runtime exception is thrown
|
void |
clear() |
boolean |
equals(java.lang.Object that) |
boolean |
equals(Sequence that) |
MetaClass |
getMetaClass()
Returns the metaclass for a given class.
|
java.lang.Object |
getProperty(java.lang.String property)
Retrieves a property value.
|
int |
hashCode() |
java.lang.Object |
invokeMethod(java.lang.String name,
java.lang.Object args)
Invokes the given method.
|
int |
minimumSize() |
java.lang.Object |
remove(int index) |
protected void |
removeRange(int fromIndex,
int toIndex) |
void |
set(java.util.Collection collection)
Sets the contents of this sequence to that
of the given collection.
|
java.lang.Object |
set(int index,
java.lang.Object element) |
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation.
|
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Sets the given property to the new value.
|
java.lang.Class |
type() |
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeIf, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
public Sequence()
public Sequence(java.lang.Class type)
public Sequence(java.lang.Class type, java.util.List content)
public void set(java.util.Collection collection)
public boolean equals(java.lang.Object that)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in class java.util.AbstractList
public boolean equals(Sequence that)
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.util.AbstractList
public int minimumSize()
public java.lang.Class type()
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.ArrayList
public boolean add(java.lang.Object element)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.ArrayList
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.ArrayList
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.ArrayList
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.ArrayList
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.ArrayList
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.ArrayList
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.ArrayList
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
GroovyObject
invokeMethod
in interface GroovyObject
name
- the name of the method to callargs
- the arguments to use for the method callpublic java.lang.Object getProperty(java.lang.String property)
GroovyObject
getProperty
in interface GroovyObject
property
- the name of the property of interestpublic void setProperty(java.lang.String property, java.lang.Object newValue)
GroovyObject
setProperty
in interface GroovyObject
property
- the name of the property of interestnewValue
- the new value for the propertypublic MetaClass getMetaClass()
GroovyObject
getMetaClass
in interface GroovyObject
public void setMetaClass(MetaClass metaClass)
GroovyObject
setMetaClass
in interface GroovyObject
metaClass
- the new metaclassprotected void checkCollectionType(java.util.Collection c)
protected void checkType(java.lang.Object object)