public class Sequence
extends ArrayList
implements GroovyObject
Represents a sequence of zero or more objects of a given type. The type can be omitted in which case any type of object can be added.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
add(int index, Object element){@inheritDoc} |
|
public boolean |
add(Object element){@inheritDoc} |
|
public boolean |
addAll(Collection c){@inheritDoc} |
|
public boolean |
addAll(int index, Collection c){@inheritDoc} |
|
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 |
|
public void |
clear(){@inheritDoc} |
|
public boolean |
equals(Object that){@inheritDoc} |
|
public boolean |
equals(Sequence that)Compares this sequence with another sequence using Groovy equality. |
|
public MetaClass |
getMetaClass()Returns the metaclass for a given class.
|
|
public Object |
getProperty(String property)Retrieves a property value.
|
|
public int |
hashCode(){@inheritDoc} |
|
public Object |
invokeMethod(String name, Object args)Invokes the given method.
|
|
public int |
minimumSize()Returns the minimum allowed size for this sequence. |
|
public Object |
remove(int index){@inheritDoc} |
|
protected void |
removeRange(int fromIndex, int toIndex){@inheritDoc} |
|
public void |
set(Collection collection)Sets the contents of this sequence to that of the given collection. |
|
public Object |
set(int index, Object element){@inheritDoc} |
|
public void |
setMetaClass(MetaClass metaClass)Allows the MetaClass to be replaced with a derived implementation.
|
|
public void |
setProperty(String property, Object newValue)Sets the given property to the new value.
|
|
public Class |
type()
|
| Methods inherited from class | Name |
|---|---|
class ArrayList |
add, add, addAll, addAll, clear, clone, contains, containsAll, ensureCapacity, equals, forEach, get, getClass, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, notify, notifyAll, parallelStream, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, stream, subList, toArray, toArray, toArray, toString, trimToSize, wait, wait, wait |
Creates a sequence with no type restriction.
Creates a sequence constrained to the supplied type.
type - the allowed element type{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
{@inheritDoc}
Checks that each member of the given collection are of the correct type
Checks that the given object instance is of the correct type otherwise a runtime exception is thrown
{@inheritDoc}
{@inheritDoc}
Compares this sequence with another sequence using Groovy equality.
that - the other sequencetrue if the sequences are equalReturns the metaclass for a given class.
Retrieves a property value.
propertyName - the name of the property of interest{@inheritDoc}
Invokes the given method.
name - the name of the method to callargs - the arguments to use for the method callReturns the minimum allowed size for this sequence.
{@inheritDoc}
{@inheritDoc}
Sets the contents of this sequence to that of the given collection.
Allows the MetaClass to be replaced with a derived implementation.
metaClass - the new metaclassSets the given property to the new value.
propertyName - the name of the property of interestnewValue - the new value for the property
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.