helma.objectmodel.db
Class OrderedSubnodeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by helma.objectmodel.db.SubnodeList
                  extended by helma.objectmodel.db.OrderedSubnodeList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
Direct Known Subclasses:
UpdateableSubnodeList

public class OrderedSubnodeList
extends SubnodeList

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
OrderedSubnodeList(WrappedNodeManager nmgr, Relation rel)
          Construct a new OrderedSubnodeList.
OrderedSubnodeList(WrappedNodeManager nmgr, Relation rel, SubnodeList origin, java.lang.String expr)
          This constructor is used to create a view for the OrderedSubnodeList origin.
 
Method Summary
 void add(int idx, java.lang.Object obj)
          Adds the specified object to the list at the given position
 boolean add(java.lang.Object obj)
          Adds the specified object to this list performing custom ordering
 boolean addAll(java.util.Collection col)
           
 boolean addSorted(java.lang.Object obj)
          Adds the specified object to this list without performing custom ordering.
static int compareNumericString(java.lang.String a, java.lang.String b)
          Compare two strings containing numbers depending on their numeric values instead of doing a lexicographical comparison.
 java.util.List getOrderedView(java.lang.String order)
           
 boolean removeAll(java.util.Collection c)
          remove all elements contained inside the specified collection from this List
 boolean retainAll(java.util.Collection c)
          remove all elements from this List, which are NOT specified inside the specified Collecion
 int sortIn(java.util.Collection col, boolean colHasDefaultOrder)
          Add all nodes contained inside the specified Collection to this UpdateableSubnodeList.
 boolean sortIn(java.lang.Object obj)
          add a new node honoring the Nodes SQL-Order
 
Methods inherited from class helma.objectmodel.db.SubnodeList
addToViews, remove, remove, removeFromViews
 
Methods inherited from class java.util.ArrayList
addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, subList
 

Constructor Detail

OrderedSubnodeList

public OrderedSubnodeList(WrappedNodeManager nmgr,
                          Relation rel)
Construct a new OrderedSubnodeList. The Relation is needed to get the information about the ORDERING


OrderedSubnodeList

public OrderedSubnodeList(WrappedNodeManager nmgr,
                          Relation rel,
                          SubnodeList origin,
                          java.lang.String expr)
This constructor is used to create a view for the OrderedSubnodeList origin.

Parameters:
origin - the origin-list which holds the elements
expr - the new order for this view
rel - the relation given for the origin-list
Method Detail

add

public boolean add(java.lang.Object obj)
Adds the specified object to this list performing custom ordering

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class SubnodeList
Parameters:
obj - element to be inserted.

add

public void add(int idx,
                java.lang.Object obj)
Adds the specified object to the list at the given position

Specified by:
add in interface java.util.List
Overrides:
add in class SubnodeList
Parameters:
idx - the index to insert the element at
obj - the object t add

addSorted

public boolean addSorted(java.lang.Object obj)
Adds the specified object to this list without performing custom ordering.

Overrides:
addSorted in class SubnodeList
Parameters:
obj - element to be inserted.

sortIn

public boolean sortIn(java.lang.Object obj)
add a new node honoring the Nodes SQL-Order

Parameters:
obj - the object to add

addAll

public boolean addAll(java.util.Collection col)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.ArrayList

sortIn

public int sortIn(java.util.Collection col,
                  boolean colHasDefaultOrder)
Add all nodes contained inside the specified Collection to this UpdateableSubnodeList. The order of the added Nodes is assumed to be ordered according to the SQL-Order-Clause given for this Subnode collection but doesn't prevent adding of unordered Collections. Ordered Collections will be sorted in more efficiently than unordered ones.

Parameters:
col - the collection containing all elements to add in the order returned by the select-statement
colHasDefaultOrder - true if the given collection does have the default-order defined by the relation

removeAll

public boolean removeAll(java.util.Collection c)
remove all elements contained inside the specified collection from this List

Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.AbstractCollection
Parameters:
c - the Collection containing all Objects to remove from this List
Returns:
true if the List has been modified

retainAll

public boolean retainAll(java.util.Collection c)
remove all elements from this List, which are NOT specified inside the specified Collecion

Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Overrides:
retainAll in class java.util.AbstractCollection
Parameters:
c - the Collection containing all Objects to keep on the List
Returns:
true if the List has been modified

compareNumericString

public static int compareNumericString(java.lang.String a,
                                       java.lang.String b)
Compare two strings containing numbers depending on their numeric values instead of doing a lexicographical comparison.

Parameters:
a - the first String
b - the second String

getOrderedView

public java.util.List getOrderedView(java.lang.String order)
Overrides:
getOrderedView in class SubnodeList


Copyright © 1998-1998-${year} Helma.org. All Rights Reserved.