org.richfaces.model
Class ListRowKey<T>

java.lang.Object
  extended by org.richfaces.model.TreeRowKey<T>
      extended by org.richfaces.model.ListRowKey<T>
All Implemented Interfaces:
java.io.Serializable

public class ListRowKey<T>
extends TreeRowKey<T>

Default TreeRowKey implementation based on ArrayList

Author:
Nick Belaevski - nbelaevski@exadel.com created 17.11.2006
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.richfaces.model.TreeRowKey
SEPARATOR_ESCAPE_CHAR
 
Constructor Summary
  ListRowKey()
          Default constructor
protected ListRowKey(java.util.ArrayList<T> list)
           
  ListRowKey(java.util.List<T> list)
          List constructor
  ListRowKey(ListRowKey<T> parentRowKey)
          Copy constructor
  ListRowKey(ListRowKey<T> parentRowKey, ListRowKey<T> childRowKey)
          Appending constructor
  ListRowKey(ListRowKey<T> parentRowKey, T pathElement)
          Appending constructor
  ListRowKey(T path)
          Deprecated.  
 
Method Summary
 int depth()
          getter for key depth
 boolean equals(java.lang.Object obj)
           
static java.lang.String[] fromString(java.lang.String keyString)
           
 T get(int i)
           
 int getCommonPathLength(TreeRowKey<T> otherRowKey)
          returns this row key and otherRowKey argument row key common path segments count
 TreeRowKey<T> getParentKey()
           
 java.lang.String getPath()
          getter for path string representation
 TreeRowKey<T> getSubKey(int fromIndex)
           
 java.util.Iterator<T> getSubPathIterator(int fromIndex)
          getter for subpath iterator
 int hashCode()
           
 boolean isSubKey(TreeRowKey<T> rowKey)
          tests if specified rowKey is sub-key of this row key
 java.util.Iterator<T> iterator()
          getter for path iterator
static void main(java.lang.String[] args)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListRowKey

public ListRowKey()
Default constructor


ListRowKey

public ListRowKey(ListRowKey<T> parentRowKey)
Copy constructor

Parameters:
parentRowKey - row key to clone

ListRowKey

public ListRowKey(ListRowKey<T> parentRowKey,
                  T pathElement)
Appending constructor

Parameters:
parentRowKey - base row key
pathElement - path segment to append to base row key

ListRowKey

public ListRowKey(ListRowKey<T> parentRowKey,
                  ListRowKey<T> childRowKey)
Appending constructor

Parameters:
parentRowKey - base row key
pathElement - path segment to append to base row key

ListRowKey

protected ListRowKey(java.util.ArrayList<T> list)

ListRowKey

public ListRowKey(T path)
Deprecated. 

Path object constructor

Parameters:
path - first path segment

ListRowKey

public ListRowKey(java.util.List<T> list)
List constructor

Parameters:
list - List of strings to create corresponding row key from
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class TreeRowKey<T>

depth

public int depth()
Description copied from class: TreeRowKey
getter for key depth

Specified by:
depth in class TreeRowKey<T>
Returns:
key depth

iterator

public java.util.Iterator<T> iterator()
Description copied from class: TreeRowKey
getter for path iterator

Specified by:
iterator in class TreeRowKey<T>
Returns:
path segments iterator

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getSubPathIterator

public java.util.Iterator<T> getSubPathIterator(int fromIndex)
Description copied from class: TreeRowKey
getter for subpath iterator

Specified by:
getSubPathIterator in class TreeRowKey<T>
Returns:
subpath segments iterator

getSubKey

public TreeRowKey<T> getSubKey(int fromIndex)
Overrides:
getSubKey in class TreeRowKey<T>

isSubKey

public boolean isSubKey(TreeRowKey<T> rowKey)
Description copied from class: TreeRowKey
tests if specified rowKey is sub-key of this row key

Overrides:
isSubKey in class TreeRowKey<T>
Returns:

getPath

public java.lang.String getPath()
Description copied from class: TreeRowKey
getter for path string representation

Specified by:
getPath in class TreeRowKey<T>
Returns:
path string

getCommonPathLength

public int getCommonPathLength(TreeRowKey<T> otherRowKey)
Description copied from class: TreeRowKey
returns this row key and otherRowKey argument row key common path segments count

Specified by:
getCommonPathLength in class TreeRowKey<T>
Parameters:
otherRowKey - TreeRowKey to count common path segments for
Returns:
common path segmments count

get

public T get(int i)

fromString

public static java.lang.String[] fromString(java.lang.String keyString)

main

public static void main(java.lang.String[] args)

getParentKey

public TreeRowKey<T> getParentKey()
Specified by:
getParentKey in class TreeRowKey<T>


Copyright © 2010. All Rights Reserved.