org.apache.tuscany.sdo.util
Class VirtualSequence

java.lang.Object
  extended by org.apache.tuscany.sdo.util.VirtualSequence
All Implemented Interfaces:
Sequence

public class VirtualSequence
extends Object
implements Sequence

SDO Sequance implementation which delegates to a Collection of DataObject properties.


Field Summary
protected  List delegateProperties
           
 
Constructor Summary
VirtualSequence(DataObject object)
           
 
Method Summary
 void add(int index, int propertyIndex, Object value)
          Adds a new entry with the specified property index and value at the specified entry index.
 boolean add(int propertyIndex, Object value)
          Adds a new entry with the specified property index and value to the end of the entries.
 void add(int index, Property p, Object value)
          Adds a new entry with the specified property and value at the specified entry index.
 void add(int index, String text)
          Deprecated.  
 void add(int index, String propertyName, Object value)
          Adds a new entry with the specified property name and value at the specified entry index.
protected static void add(Object value, List list, int index, int size)
           
 boolean add(Property p, Object value)
          Adds a new entry with the specified property and value to the end of the entries.
protected static void add(Property property, Object value, Sequence toSequence, int toIndex, int size)
           
 void add(String text)
          Deprecated.  
 boolean add(String propertyName, Object value)
          Adds a new entry with the specified property name and value to the end of the entries.
 void addText(int index, String text)
          Adds a new text entry at the given index.
 void addText(String text)
          Adds a new text entry to the end of the Sequence.
 Property getProperty(int index)
          Returns the property for the given entry index.
 Object getValue(int index)
          Returns the property value for the given entry index.
protected  int insert(Iterator iterator, Property p, Object value)
           
protected static boolean isSequenceProperty(Object property)
           
 void move(int toIndex, int fromIndex)
          Moves the entry at fromIndex to toIndex.
protected static void move(Sequence fromSequence, int fromIndex, Sequence toSequence, int toIndex)
           
protected  Property property(int index)
           
protected  Property property(String name)
           
 void remove(int index)
          Removes the entry at the given entry index.
 Object setValue(int index, Object value)
          Sets the entry at a specified index to the new value.
 int size()
          Returns the number of entries in the sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegateProperties

protected final List delegateProperties
Constructor Detail

VirtualSequence

public VirtualSequence(DataObject object)
Method Detail

isSequenceProperty

protected static boolean isSequenceProperty(Object property)

size

public int size()
Description copied from interface: Sequence
Returns the number of entries in the sequence.

Specified by:
size in interface Sequence
Returns:
the number of entries.

getProperty

public Property getProperty(int index)
Description copied from interface: Sequence
Returns the property for the given entry index. Returns null for mixed text entries.

Specified by:
getProperty in interface Sequence
Parameters:
index - the index of the entry.
Returns:
the property or null for the given entry index.

getValue

public Object getValue(int index)
Description copied from interface: Sequence
Returns the property value for the given entry index.

Specified by:
getValue in interface Sequence
Parameters:
index - the index of the entry.
Returns:
the value for the given entry index.

setValue

public Object setValue(int index,
                       Object value)
Description copied from interface: Sequence
Sets the entry at a specified index to the new value.

Specified by:
setValue in interface Sequence
Parameters:
index - the index of the entry.
value - the new value for the entry.

add

public final boolean add(Property p,
                         Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property and value to the end of the entries.

Specified by:
add in interface Sequence
Parameters:
p - the property of the entry.
value - the value for the entry.

property

protected final Property property(String name)

add

public boolean add(String propertyName,
                   Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property name and value to the end of the entries.

Specified by:
add in interface Sequence
Parameters:
propertyName - the name of the entry's property.
value - the value for the entry.

property

protected final Property property(int index)

add

public boolean add(int propertyIndex,
                   Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property index and value to the end of the entries.

Specified by:
add in interface Sequence
Parameters:
propertyIndex - the index of the entry's property.
value - the value for the entry.

insert

protected final int insert(Iterator iterator,
                           Property p,
                           Object value)

add

public final void add(int index,
                      Property p,
                      Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property and value at the specified entry index.

Specified by:
add in interface Sequence
Parameters:
index - the index at which to add the entry.
p - the property of the entry.
value - the value for the entry.

add

public void add(int index,
                String propertyName,
                Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property name and value at the specified entry index.

Specified by:
add in interface Sequence
Parameters:
index - the index at which to add the entry.
propertyName - the name of the entry's property.
value - the value for the entry.

add

public void add(int index,
                int propertyIndex,
                Object value)
Description copied from interface: Sequence
Adds a new entry with the specified property index and value at the specified entry index.

Specified by:
add in interface Sequence
Parameters:
index - the index at which to add the entry.
propertyIndex - the index of the entry's property.
value - the value for the entry.

addText

public final void addText(String text)
Description copied from interface: Sequence
Adds a new text entry to the end of the Sequence.

Specified by:
addText in interface Sequence
Parameters:
text - value of the entry.

add

public void add(String text)
Deprecated. 

Specified by:
add in interface Sequence

addText

public final void addText(int index,
                          String text)
Description copied from interface: Sequence
Adds a new text entry at the given index.

Specified by:
addText in interface Sequence
Parameters:
index - the index at which to add the entry.
text - value of the entry.

add

public void add(int index,
                String text)
Deprecated. 

Specified by:
add in interface Sequence

remove

public void remove(int index)
Description copied from interface: Sequence
Removes the entry at the given entry index.

Specified by:
remove in interface Sequence
Parameters:
index - the index of the entry.

move

protected static void move(Sequence fromSequence,
                           int fromIndex,
                           Sequence toSequence,
                           int toIndex)

add

protected static void add(Object value,
                          List list,
                          int index,
                          int size)

add

protected static void add(Property property,
                          Object value,
                          Sequence toSequence,
                          int toIndex,
                          int size)

move

public void move(int toIndex,
                 int fromIndex)
Description copied from interface: Sequence
Moves the entry at fromIndex to toIndex.

Specified by:
move in interface Sequence
Parameters:
toIndex - the index of the entry destination.
fromIndex - the index of the entry to move.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.