Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl.util
Class LocatableList

    java.lang.Object
      java.util.AbstractCollection
          java.util.AbstractList
              java.util.AbstractSequentialList
                  java.util.LinkedList
                      org.ensembl.util.LocatableList

All Implemented Interfaces:
  java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class LocatableList
extends java.util.LinkedList

Container for locatables that offers a convenient means of retrieving an array of the locatable's internalIDs where the locatables are sorted by genomic location. Note that the type of Object added to list via the add() methods is not tested but they should be Locatable. The type is not checked when added because the overhead of doing so could be prohibitive. If a non Locatable item is added then an Exception will be thrown when toSortedInternalIDArray() is called.

Author:
  Craig Melsopp
See Also:
  Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`LocatableList()`

Method Summary
`void` | `add(int index, java.lang.Object element)`
`boolean` | `add(java.lang.Object o)` Adds a locatable instance to the list.
`boolean` | `addAll(java.util.Collection c)` Adds all the Locatables from the collection into this list.
`boolean` | `addAll(int index, java.util.Collection c)` Adds all the Locatables from the collection into this list.
`void` | `addFirst(java.lang.Object o)` Adds a locatable instance to the beginning of this list.
`void` | `addLast(java.lang.Object o)` Adds a locatable instance to the end of the list.
`long[]` | `toSortedInternalIDArray()` Sorts locatable's by genomic location and returns an array of the locatable's internalIDs.

Methods inherited from class java.util.LinkedList
`clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray`

Methods inherited from class java.util.AbstractSequentialList
`iterator`

Methods inherited from class java.util.AbstractList
`equals, hashCode, listIterator, removeRange, subList`

Methods inherited from class java.util.AbstractCollection
`containsAll, isEmpty, removeAll, retainAll, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.List
`containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList`

Constructor Detail

### LocatableList

    public LocatableList()

Method Detail

### add

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

### add

    public boolean add(java.lang.Object o)

  Adds a locatable instance to the list.

  Parameters:
    `o` - a Locatable instance.
  See Also:
    `Locatable`

### addAll

    public boolean addAll(java.util.Collection c)

  Adds all the Locatables from the collection into this list.

  Parameters:
    `c` - collection of Locatables.
  See Also:
    `Locatable`

### addAll

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

  Adds all the Locatables from the collection into this list.

  Parameters:
    `index` - index at which to insert first element from the specified collection.
    `c` - Collection of Locatables.
  Returns:
    `true` if this list changed as a result of the call.
  See Also:
    `Locatable`

### addFirst

    public void addFirst(java.lang.Object o)

  Adds a locatable instance to the beginning of this list.

  Parameters:
    `o` - a Locatable instance.
  See Also:
    `Locatable`

### addLast

    public void addLast(java.lang.Object o)

  Adds a locatable instance to the end of the list.

  Parameters:
    `o` - a Locatable instance.
  See Also:
    `Locatable`

### toSortedInternalIDArray

    public long[] toSortedInternalIDArray()

  Sorts locatable's by genomic location and returns an array of the locatable's internalIDs.

  Returns:
    zero or more internalIDs.
  Throws:
    `java.lang.ClassCastException` - if a non Locatable item was added to the list.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD