gov.nasa.pds.tools.label
Class Sequence

java.lang.Object
  extended by gov.nasa.pds.tools.label.Sequence
All Implemented Interfaces:
Value, Iterable<Value>, Collection<Value>, List<Value>

public class Sequence
extends Object
implements List<Value>, Value

This class implements the List interface to hide its backing. It is a ordered set of Value. A sequence can appear on the right hand side of an AttributeStatement.

Version:
$Revision: 8263 $
Author:
pramirez, jagander

Constructor Summary
Sequence()
          Constructs an empty sequence of values.
Sequence(List<Value> values)
          Constructs a sequence with the ordered value
 
Method Summary
 void add(int index, Value object)
           
 boolean add(Value object)
           
 boolean addAll(Collection<? extends Value> vals)
           
 boolean addAll(int index, Collection<? extends Value> vals)
           
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection<?> vals)
           
 boolean equals(Object object)
           
 Value get(int index)
           
 Value getValue(int index)
           
 int hashcode()
           
 int indexOf(Object object)
           
 boolean isEmpty()
           
 Iterator<Value> iterator()
           
 int lastIndexOf(Object object)
           
 ListIterator<Value> listIterator()
           
 ListIterator<Value> listIterator(int index)
           
 String normalize()
           
 Value remove(int index)
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> vals)
           
 Scalar removeScalar(int index)
           
 boolean retainAll(Collection<?> vals)
           
 Value set(int index, Value value)
           
 int size()
           
 List<Value> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] objects)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

Sequence

public Sequence()
Constructs an empty sequence of values.


Sequence

public Sequence(List<Value> values)
Constructs a sequence with the ordered value

Parameters:
values - to load into sequence
Method Detail

containsAll

public boolean containsAll(Collection<?> vals)
Specified by:
containsAll in interface Collection<Value>
Specified by:
containsAll in interface List<Value>

addAll

public boolean addAll(Collection<? extends Value> vals)
Specified by:
addAll in interface Collection<Value>
Specified by:
addAll in interface List<Value>

addAll

public boolean addAll(int index,
                      Collection<? extends Value> vals)
Specified by:
addAll in interface List<Value>

removeAll

public boolean removeAll(Collection<?> vals)
Specified by:
removeAll in interface Collection<Value>
Specified by:
removeAll in interface List<Value>

retainAll

public boolean retainAll(Collection<?> vals)
Specified by:
retainAll in interface Collection<Value>
Specified by:
retainAll in interface List<Value>

clear

public void clear()
Specified by:
clear in interface Collection<Value>
Specified by:
clear in interface List<Value>

getValue

public Value getValue(int index)

set

public Value set(int index,
                 Value value)
Specified by:
set in interface List<Value>

removeScalar

public Scalar removeScalar(int index)

listIterator

public ListIterator<Value> listIterator()
Specified by:
listIterator in interface List<Value>

listIterator

public ListIterator<Value> listIterator(int index)
Specified by:
listIterator in interface List<Value>

subList

public List<Value> subList(int fromIndex,
                           int toIndex)
Specified by:
subList in interface List<Value>

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection<Value>
Specified by:
contains in interface List<Value>

toArray

public <T> T[] toArray(T[] objects)
Specified by:
toArray in interface Collection<Value>
Specified by:
toArray in interface List<Value>

add

public boolean add(Value object)
Specified by:
add in interface Collection<Value>
Specified by:
add in interface List<Value>

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<Value>
Specified by:
remove in interface List<Value>

add

public void add(int index,
                Value object)
Specified by:
add in interface List<Value>

indexOf

public int indexOf(Object object)
Specified by:
indexOf in interface List<Value>

lastIndexOf

public int lastIndexOf(Object object)
Specified by:
lastIndexOf in interface List<Value>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Value>
Specified by:
toArray in interface List<Value>

get

public Value get(int index)
Specified by:
get in interface List<Value>

remove

public Value remove(int index)
Specified by:
remove in interface List<Value>

size

public int size()
Specified by:
size in interface Collection<Value>
Specified by:
size in interface List<Value>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Value>
Specified by:
isEmpty in interface List<Value>

iterator

public Iterator<Value> iterator()
Specified by:
iterator in interface Iterable<Value>
Specified by:
iterator in interface Collection<Value>
Specified by:
iterator in interface List<Value>

normalize

public String normalize()
Specified by:
normalize in interface Value

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Specified by:
equals in interface Collection<Value>
Specified by:
equals in interface List<Value>
Overrides:
equals in class Object

hashcode

public int hashcode()


Copyright © 2005–2013 Planetary Data System. All rights reserved.