org.nodal.model
Interface SequenceContent

All Superinterfaces:
Content
All Known Subinterfaces:
SequenceNode, SequenceNode.Editor
All Known Implementing Classes:
BareSequence, SequenceFilter

public interface SequenceContent
extends Content

The specific interface for accessing the content of a Node whose type is an instance of SequenceType.

A SequenceNode consists of an ordered, dense set of values of a uniform type indexed by the positive integers from 0 through size-1. A negative index i refers to the item at index size+i. Therefore the actual range of valid indices is [-size,size-1].

Author:
Lee Iverson
See Also:
Content

Nested Class Summary
static interface SequenceContent.Editor
          Encapsulates the ability to modify SequenceContent objects.
 
Method Summary
 Seq asSeq()
          Create and return the current contents of this container as a Seq.
 java.lang.Object getItem(int index)
          Return the Object at the given index.
 boolean indexIsValid(int i)
          Check that a given index is valid.
 Getter item(int index)
          Return a Getter for the item at the given index.
 Getter range(int start, int end)
          Return a Getter for the sequence of items indexed from start to end, inclusive.
 
Methods inherited from interface org.nodal.model.Content
getValue, invert, isValidProperty, properties, size, type, value
 

Method Detail

asSeq

public Seq asSeq()
Create and return the current contents of this container as a Seq. The subtype of this Seq will depend on the type of content. e.g a type will return a ByteSeq object.

Returns:
a Seq object apprpriate to the type.

indexIsValid

public boolean indexIsValid(int i)
Check that a given index is valid.

Parameters:
i - the index
Returns:
true if this is a valid point to get/set a value

item

public Getter item(int index)
            throws IndexBoundsException
Return a Getter for the item at the given index.

Throws:
IndexBoundsException

getItem

public java.lang.Object getItem(int index)
                         throws IndexBoundsException
Return the Object at the given index.

Throws:
IndexBoundsException

range

public Getter range(int start,
                    int end)
             throws IndexBoundsException
Return a Getter for the sequence of items indexed from start to end, inclusive.

The value returned by the Getter is an instance of org.nodal.util.Seq.

Throws:
IndexBoundsException
See Also:
Seq