org.nodal.model
Interface SequenceContent.Editor

All Superinterfaces:
Content.Editor
All Known Subinterfaces:
SequenceNode.Editor
Enclosing interface:
SequenceContent

public static interface SequenceContent.Editor
extends Content.Editor

Encapsulates the ability to modify SequenceContent objects. Created on Jul 22, 2003

Author:
leei

Method Summary
 Setter insertAfter(int index)
          Return a Setter that inserts values after the index start.
 Setter insertBefore(int index)
          Return a Setter that inserts values before teh index start.
 boolean removeRange(int start, int end)
          Remove the range [start,end].
 Setter replaceRange(int start, int end)
          Return a Setter that replaces the range [start,end]
 Seq setAll(java.lang.Object val)
          Set the entire contents of this collection from the given val.
 Setter setItem(int i)
          Return a Setter that sets the item at index i.
 
Methods inherited from interface org.nodal.model.Content.Editor
modify, setValue
 

Method Detail

setItem

public Setter setItem(int i)
               throws IndexBoundsException
Return a Setter that sets the item at index i.

Throws:
IndexBoundsException

setAll

public Seq setAll(java.lang.Object val)
           throws ConstraintFailure
Set the entire contents of this collection from the given val. Shorthand for this.replaceRange(0,-1).set(val).

Parameters:
val - the value to set this object's contents to
Throws:
ConstraintFailure

replaceRange

public Setter replaceRange(int start,
                           int end)
                    throws IndexBoundsException
Return a Setter that replaces the range [start,end]

Throws:
IndexBoundsException

removeRange

public boolean removeRange(int start,
                           int end)
                    throws IndexBoundsException
Remove the range [start,end].

An equivalent operation can be performed by setting the Setter returned by replaceValue(start,end) to null.

Throws:
IndexBoundsException

insertBefore

public Setter insertBefore(int index)
                    throws IndexBoundsException
Return a Setter that inserts values before teh index start.

The IndexBoundsException is raised if start is an invalid index, unless start is 0 which will prepend values to this Sequence even if it is empty.

Throws:
IndexBoundsException

insertAfter

public Setter insertAfter(int index)
                   throws IndexBoundsException
Return a Setter that inserts values after the index start.

The IndexBoundsException is raised if start is an invalid index, unless start is -1 which will append values to this Sequence even if it is empty.

Throws:
IndexBoundsException