org.objectweb.telosys.common.vo
Class GenericVOList

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.common.vo.GenericVOList
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LooselyTypedVOList

public abstract class GenericVOList
extends TelosysObject
implements java.io.Serializable

Generic abstract class to build Value Objects List

See Also:
Serialized Form

Constructor Summary
protected GenericVOList(java.lang.Class eltClass)
           
 
Method Summary
protected  void addElement(java.lang.Object newElement)
          Appends the given element to the end of the list
 void clear()
          Removes all of the elements from this list
protected  java.lang.Object getElement(int index)
           
 java.lang.Class getElementType()
          Returns the type (class) of the elements stored in the list
protected  java.lang.Object getFirstElement()
           
 java.util.List getList()
          Returns the encapsulated List object
protected  java.lang.Object getNextElement()
           
 java.lang.Object getSelectedElement()
          Returns the current selected element (or null if no element selected)
 int getSelectedIndex()
          Returns the current selected index (or -1 if no selection)
 java.lang.String getSortField()
          Returns the field name used as current sort criteria
protected  void insertElement(int index, java.lang.Object newElement)
           
 boolean isEmpty()
          Returns 'true' if this list contains no elements
 boolean isSelected(int iIndex)
          Returns true if the given index is the current selected index
 boolean isSortedBy(java.lang.String sFieldName)
          Returns true if the list is currently sorted by the given field
 boolean isSortedInAscendingOrder()
          Returns true if the list is currently sorted in ascending order
 boolean isSortedInDescendingOrder()
          Returns true if the list is currently sorted in descending order
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list in proper sequence
 java.util.ListIterator listIterator()
          Returns a list iterator of the elements in this list (in proper sequence)
protected  java.lang.Object removeElement(int index)
           
protected  boolean removeElement(java.lang.Object element)
           
protected  java.lang.Object replaceElement(int index, java.lang.Object newElement)
           
 boolean replaceSelectedElement(java.lang.Object newElement)
          Replaces the current selected element if any
 int select(int iNewSelectedIndex)
          Select the given index
 int size()
          Returns the number of elements in this list.
 void sort(java.lang.String sFieldName)
          Sort the list using the given field as criteria (case sensitive) in ascending order
 void sort(java.lang.String sFieldName, java.lang.String sOrder)
          Sort the list using the given field as criteria (case sensitive) and the specified order ( ascending or descending )
 void sortIgnoreCase(java.lang.String sFieldName)
          Sort the list using the given field as criteria ( ignoring case ) in ascending order
 void sortIgnoreCase(java.lang.String sFieldName, java.lang.String sOrder)
          Sort the list using the given field as criteria ( ignoring case ) and the specified order ( ascending or descending )
 java.lang.String toString()
           
 int unselect()
          Set the list in a state where there's no selected element (no selected index)
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericVOList

protected GenericVOList(java.lang.Class eltClass)
Method Detail

addElement

protected void addElement(java.lang.Object newElement)
Appends the given element to the end of the list

Parameters:
newElement -

insertElement

protected void insertElement(int index,
                             java.lang.Object newElement)

replaceElement

protected java.lang.Object replaceElement(int index,
                                          java.lang.Object newElement)

removeElement

protected boolean removeElement(java.lang.Object element)

removeElement

protected java.lang.Object removeElement(int index)

getElement

protected java.lang.Object getElement(int index)

getFirstElement

protected java.lang.Object getFirstElement()

getNextElement

protected java.lang.Object getNextElement()

getElementType

public java.lang.Class getElementType()
Returns the type (class) of the elements stored in the list

Returns:

getList

public java.util.List getList()
Returns the encapsulated List object

Returns:

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list in proper sequence

Returns:
the iterator

listIterator

public java.util.ListIterator listIterator()
Returns a list iterator of the elements in this list (in proper sequence)

Returns:
the list iterator

size

public int size()
Returns the number of elements in this list.

Returns:

isEmpty

public boolean isEmpty()
Returns 'true' if this list contains no elements

Returns:

clear

public void clear()
Removes all of the elements from this list


select

public int select(int iNewSelectedIndex)
Select the given index

Parameters:
iNewSelectedIndex -
Returns:
the previous selected index

unselect

public int unselect()
Set the list in a state where there's no selected element (no selected index)

Returns:
the previous selected index

getSelectedIndex

public int getSelectedIndex()
Returns the current selected index (or -1 if no selection)

Returns:

isSelected

public boolean isSelected(int iIndex)
Returns true if the given index is the current selected index

Parameters:
iIndex -
Returns:

getSelectedElement

public java.lang.Object getSelectedElement()
Returns the current selected element (or null if no element selected)

Returns:

replaceSelectedElement

public boolean replaceSelectedElement(java.lang.Object newElement)
Replaces the current selected element if any

Parameters:
newElement -
Returns:
true if done (if there is a valid current selected index), else false

getSortField

public java.lang.String getSortField()
Returns the field name used as current sort criteria

Returns:
: field name, or "" if the list is not sorted

isSortedBy

public boolean isSortedBy(java.lang.String sFieldName)
Returns true if the list is currently sorted by the given field

Parameters:
sFieldName -
Returns:
true/false

isSortedInAscendingOrder

public boolean isSortedInAscendingOrder()
Returns true if the list is currently sorted in ascending order

Returns:

isSortedInDescendingOrder

public boolean isSortedInDescendingOrder()
Returns true if the list is currently sorted in descending order

Returns:

sort

public void sort(java.lang.String sFieldName)
Sort the list using the given field as criteria (case sensitive) in ascending order

Parameters:
sFieldName - : the name of the field to compare

sort

public void sort(java.lang.String sFieldName,
                 java.lang.String sOrder)
Sort the list using the given field as criteria (case sensitive) and the specified order ( ascending or descending )

Parameters:
sFieldName - : the name of the field to compare
sOrder - : 'ASC' = ascending order , 'DESC' = descending order

sortIgnoreCase

public void sortIgnoreCase(java.lang.String sFieldName)
Sort the list using the given field as criteria ( ignoring case ) in ascending order

Parameters:
sFieldName - : the name of the field to compare

sortIgnoreCase

public void sortIgnoreCase(java.lang.String sFieldName,
                           java.lang.String sOrder)
Sort the list using the given field as criteria ( ignoring case ) and the specified order ( ascending or descending )

Parameters:
sFieldName - : the name of the field to compare
sOrder - : 'ASC' = ascending order , 'DESC' = descending order

toString

public java.lang.String toString()