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