com.adhi.adhij
Class RowSet

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.ArrayList
              extended by com.adhi.adhij.RowSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class RowSet
extends java.util.ArrayList

The Row set class has matrix like representation. It has rows and columns. Ideal for table like data structure.

Author:
DKRISHNA
See Also:
Serialized Form

Field Summary
static int ASCENDING
          sorting order - ascending
static int DESCENDING
          sorting order - descending
 
Constructor Summary
RowSet()
           
 
Method Summary
 void add(java.util.ArrayList row)
          add a row to this row set
 void sort(int column)
          sort by the column in ascending order
 void sort(int column, int orderType)
          sort the rowset by the column and by the sort type (ascending or descending order).
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, 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, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

ASCENDING

public static final int ASCENDING
sorting order - ascending

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
sorting order - descending

See Also:
Constant Field Values
Constructor Detail

RowSet

public RowSet()
Method Detail

add

public void add(java.util.ArrayList row)
add a row to this row set

Parameters:
row - the row

sort

public void sort(int column,
                 int orderType)
sort the rowset by the column and by the sort type (ascending or descending order). The object in the column should implement comparable

Parameters:
column - the column to be sorted by
orderType - the order of sort (ascending or descending)

sort

public void sort(int column)
sort by the column in ascending order

Parameters:
column - the column to be sorted by