Groovy Documentation

## groovy.lang
[Java] Class Sequence

    java.lang.Object
      java.util.AbstractCollection
          java.util.AbstractList
              java.util.ArrayList
                  groovy.lang.Sequence

All Implemented Interfaces:
  GroovyObject

    public class Sequence
    extends java.util.ArrayList

Represents a sequence of objects which represents zero or many instances of of objects of a given type. The type can be omitted in which case any type of object can be added.

Authors:
  James Strachan

Version:
  \$Revision\$

Constructor Summary
`Sequence()`
`Sequence(java.lang.Class type)`
`Sequence(java.lang.Class type, java.util.List content)`

Method Summary
`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()`
`java.lang.Object` | `getProperty(java.lang.String property)`
`int` | `hashCode()`
`java.lang.Object` | `invokeMethod(java.lang.String name, java.lang.Object args)`
`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)`
`void` | `setProperty(java.lang.String property, java.lang.Object newValue)`
`java.lang.Class` | `type()` @return the type of the elements in the sequence or null if there is no type constraint on this sequence

Methods inherited from class java.util.ArrayList

java.util.ArrayList#add(java.lang.Object), java.util.ArrayList#add(int, java.lang.Object), java.util.ArrayList#get(int), java.util.ArrayList#clone(), java.util.ArrayList#indexOf(java.lang.Object), java.util.ArrayList#clear(), java.util.ArrayList#size(), java.util.ArrayList#isEmpty(), java.util.ArrayList#lastIndexOf(java.lang.Object), java.util.ArrayList#contains(java.lang.Object), java.util.ArrayList#subList(int, int), java.util.ArrayList#toArray(), java.util.ArrayList#toArray([Ljava.lang.Object;), java.util.ArrayList#remove(int), java.util.ArrayList#remove(java.lang.Object), java.util.ArrayList#addAll(java.util.Collection), java.util.ArrayList#addAll(int, java.util.Collection), java.util.ArrayList#iterator(), java.util.ArrayList#set(int, java.lang.Object), java.util.ArrayList#trimToSize(), java.util.ArrayList#ensureCapacity(int), java.util.ArrayList#removeAll(java.util.Collection), java.util.ArrayList#retainAll(java.util.Collection), java.util.ArrayList#listIterator(int), java.util.ArrayList#listIterator(), java.util.ArrayList#equals(java.lang.Object), java.util.ArrayList#hashCode(), java.util.ArrayList#toString(), java.util.ArrayList#containsAll(java.util.Collection), java.util.ArrayList#wait(long), java.util.ArrayList#wait(long, int), java.util.ArrayList#wait(), java.util.ArrayList#getClass(), java.util.ArrayList#notify(), java.util.ArrayList#notifyAll()

Methods inherited from class java.util.AbstractList

java.util.AbstractList#add(java.lang.Object), java.util.AbstractList#add(int, java.lang.Object), java.util.AbstractList#get(int), java.util.AbstractList#equals(java.lang.Object), java.util.AbstractList#hashCode(), java.util.AbstractList#indexOf(java.lang.Object), java.util.AbstractList#clear(), java.util.AbstractList#lastIndexOf(java.lang.Object), java.util.AbstractList#subList(int, int), java.util.AbstractList#remove(int), java.util.AbstractList#addAll(int, java.util.Collection), java.util.AbstractList#iterator(), java.util.AbstractList#set(int, java.lang.Object), java.util.AbstractList#listIterator(), java.util.AbstractList#listIterator(int), java.util.AbstractList#toString(), java.util.AbstractList#size(), java.util.AbstractList#isEmpty(), java.util.AbstractList#contains(java.lang.Object), java.util.AbstractList#toArray(), java.util.AbstractList#toArray([Ljava.lang.Object;), java.util.AbstractList#remove(java.lang.Object), java.util.AbstractList#addAll(java.util.Collection), java.util.AbstractList#containsAll(java.util.Collection), java.util.AbstractList#removeAll(java.util.Collection), java.util.AbstractList#retainAll(java.util.Collection), java.util.AbstractList#wait(long), java.util.AbstractList#wait(long, int), java.util.AbstractList#wait(), java.util.AbstractList#getClass(), java.util.AbstractList#notify(), java.util.AbstractList#notifyAll(), java.util.AbstractList#size()

Constructor Detail

### Sequence

    public Sequence()

### Sequence

    public Sequence(java.lang.Class type)

### Sequence

    public Sequence(java.lang.Class type, java.util.List content)

Method Detail

### add

    public void add(int index, java.lang.Object element)

### add

    public boolean add(java.lang.Object element)

### addAll

    public boolean addAll(java.util.Collection c)

### addAll

    public boolean addAll(int index, java.util.Collection c)

### checkCollectionType

    protected void checkCollectionType(java.util.Collection c)

  Checks that each member of the given collection are of the correct type

### checkType

    protected void checkType(java.lang.Object object)

  Checks that the given object instance is of the correct type otherwise a runtime exception is thrown

### clear

    public void clear()

### equals

    public boolean equals(java.lang.Object that)

### equals

    public boolean equals(Sequence that)

### getMetaClass

    public MetaClass getMetaClass()

### getProperty

    public java.lang.Object getProperty(java.lang.String property)

### hashCode

    public int hashCode()

### invokeMethod

    public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)

### minimumSize

    public int minimumSize()

### remove

    public java.lang.Object remove(int index)

### removeRange

    protected void removeRange(int fromIndex, int toIndex)

### set

    public void set(java.util.Collection collection)

  Sets the contents of this sequence to that of the given collection.

### set

    public java.lang.Object set(int index, java.lang.Object element)

### setMetaClass

    public void setMetaClass(MetaClass metaClass)

### setProperty

    public void setProperty(java.lang.String property, java.lang.Object newValue)

### type

    public java.lang.Class type()

  Returns:
    the type of the elements in the sequence or null if there is no type constraint on this sequence

Groovy Documentation