gov.nasa.pds.tools.label
Class Sequence

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

public class Sequence
extends java.lang.Object
implements java.util.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: 4967 $
Author:
pramirez, jagander

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

Constructor Detail

Sequence

public Sequence()
Constructs an empty sequence of values.


Sequence

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

Parameters:
values - to load into sequence
Method Detail

containsAll

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

addAll

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

addAll

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

removeAll

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

retainAll

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

clear

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

getValue

public Value getValue(int index)

set

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

removeScalar

public Scalar removeScalar(int index)

listIterator

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

listIterator

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

subList

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

contains

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

toArray

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

add

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

remove

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

add

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

indexOf

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

lastIndexOf

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

toArray

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

get

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

remove

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

size

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

isEmpty

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

iterator

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

normalize

public java.lang.String normalize()
Specified by:
normalize in interface Value


Copyright © 2005-2009 Planetary Data System. All Rights Reserved.