com.cc.framework.util
Class ListHelp

java.lang.Object
  extended bycom.cc.framework.util.ListHelp

public abstract class ListHelp
extends java.lang.Object

Helper for processing ListDataModels

Since:
1.0
Version:
$Revision: 1.25 $
Author:
Harald Schulz

Constructor Summary
private ListHelp()
          Constructor
 
Method Summary
static void check(ListDataModel list, AlgorithmFilter filter)
          Checks all elements in a list.
static void check(ListDataModel list, java.lang.String property, AlgorithmFilter filter)
          Checks a property for all elements in a list.
static void checkAll(ListDataModel list)
          Checks all elements in a list.
static void checkAll(ListDataModel list, java.lang.String property)
          Checks all elements in a list.
static java.util.Map getCheckedItems(ListDataModel list)
          Returns an Array including all the matching row beans of the list.
static java.util.Map getCheckedItems(ListDataModel list, java.lang.String property)
          Returns an Array including all the matching row beans in a list.
static java.util.Map getItemsByState(ListDataModel list, CheckState state)
          Returns a collection for all element in the list which fits the specified check state.
static java.util.Map getItemsByState(ListDataModel list, java.lang.String property, CheckState state)
          Returns a collection for all element in the list which fits the specified check state.
static java.lang.Object getLineFromKey(ListDataModel list, java.lang.String key)
          Returns the Row (Object) with the specified key from the list.
static java.util.Map getUncheckedItems(ListDataModel list)
          Returns an Array including all the matching row beans of the list.
static java.util.Map getUncheckedItems(ListDataModel list, java.lang.String property)
          Returns an Array including all the matching row beans of the list.
static int indexOf(ListDataModel list, java.lang.String key)
          Returns the index of the row with the specified key from the list.
static java.lang.Object iterateNodes(LineIterator iter, Algorithm alg)
          This method processes an algorithm for all elements (nodes) in the list.
static java.lang.Object iterateNodes(LineIterator iter, Algorithm alg, AlgorithmFilter filter)
          This method processes an algorithm for all elements (nodes) in the list.
static java.lang.Object iterateNodes(ListDataModel list, Algorithm alg)
          This method processes an algorithm for all elements (nodes) in the list.
static java.lang.Object iterateNodes(ListDataModel list, Algorithm alg, AlgorithmFilter filter)
          This method processes an algorithm for all elements (nodes) in the list.
static void uncheck(ListDataModel list, AlgorithmFilter filter)
          Clears all selected elements in a list.
static void uncheck(ListDataModel list, java.lang.String property, AlgorithmFilter filter)
          Unchecks only the checked Items in a List
static void uncheckAll(ListDataModel list)
          Clears all selected elements in a list.
static void uncheckAll(ListDataModel list, java.lang.String property)
          Unchecks only the checked Items in a List
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListHelp

private ListHelp()
Constructor

Method Detail

getLineFromKey

public static java.lang.Object getLineFromKey(ListDataModel list,
                                              java.lang.String key)
                                       throws java.lang.Exception
Returns the Row (Object) with the specified key from the list.

Parameters:
list - ListDataModel
key - Key
Returns:
Object
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

iterateNodes

public static java.lang.Object iterateNodes(ListDataModel list,
                                            Algorithm alg)
                                     throws java.lang.Exception
This method processes an algorithm for all elements (nodes) in the list.

Parameters:
list - ListDataModel
alg - Algorithm to execute
Returns:
The object where the iteration terminated or null
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Algorithm.execute(String, Object)

iterateNodes

public static java.lang.Object iterateNodes(ListDataModel list,
                                            Algorithm alg,
                                            AlgorithmFilter filter)
                                     throws java.lang.Exception
This method processes an algorithm for all elements (nodes) in the list.

Parameters:
list - ListDataModel
alg - Algorithm to execute
filter - The row filter
Returns:
The object where the iteration terminated or null
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Algorithm.execute(String, Object)

iterateNodes

public static java.lang.Object iterateNodes(LineIterator iter,
                                            Algorithm alg)
                                     throws java.lang.Exception
This method processes an algorithm for all elements (nodes) in the list.

Parameters:
iter - List Iterator
alg - Algorithm to execute
Returns:
The object where the iteration terminated or null
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Algorithm.execute(String, Object)

iterateNodes

public static java.lang.Object iterateNodes(LineIterator iter,
                                            Algorithm alg,
                                            AlgorithmFilter filter)
                                     throws java.lang.Exception
This method processes an algorithm for all elements (nodes) in the list.

Parameters:
iter - List Iterator
alg - Algorithm to execute
filter - The row filter
Returns:
The object where the iteration terminated or null
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Algorithm.execute(String, Object)

indexOf

public static int indexOf(ListDataModel list,
                          java.lang.String key)
Returns the index of the row with the specified key from the list.

Parameters:
list - ListDataModel
key - Key
Returns:
integer

uncheckAll

public static void uncheckAll(ListDataModel list)
                       throws java.lang.Exception
Clears all selected elements in a list. Therefore the elements in the list must implement the checkabel interface. Only the checked items (1) will be reseted! Items with an undefined state will (-1) not be affected.

Parameters:
list - ListDataModel
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Checkable

uncheck

public static void uncheck(ListDataModel list,
                           AlgorithmFilter filter)
                    throws java.lang.Exception
Clears all selected elements in a list. Therefore the elements in the list must implement the checkabel interface. Only the checked items (1) will be reseted! Items with an undefined state will (-1) not be affected.

Parameters:
list - ListDataModel
filter - Row Filter
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Checkable

uncheckAll

public static void uncheckAll(ListDataModel list,
                              java.lang.String property)
                       throws java.lang.Exception
Unchecks only the checked Items in a List

Parameters:
list - List Data model
property - The check property
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

uncheck

public static void uncheck(ListDataModel list,
                           java.lang.String property,
                           AlgorithmFilter filter)
                    throws java.lang.Exception
Unchecks only the checked Items in a List

Parameters:
list - List Data model
property - The check property
filter - the row filter
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

checkAll

public static void checkAll(ListDataModel list)
                     throws java.lang.Exception
Checks all elements in a list. Therefore the elements in the list must implement the checkabel interface. Only the unchecked items (0) will be checked! Items with an undefined state will (-1) not be affected.

Parameters:
list - ListDataModel
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Checkable

checkAll

public static void checkAll(ListDataModel list,
                            java.lang.String property)
                     throws java.lang.Exception
Checks all elements in a list.

Parameters:
list - List Data model
property - The check property
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

check

public static void check(ListDataModel list,
                         AlgorithmFilter filter)
                  throws java.lang.Exception
Checks all elements in a list. Therefore the elements in the list must implement the checkabel interface. Only the unchecked items (0) will be checked! Items with an undefined state will (-1) not be affected.

Parameters:
list - ListDataModel
filter - The row filter
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm
See Also:
Checkable

check

public static void check(ListDataModel list,
                         java.lang.String property,
                         AlgorithmFilter filter)
                  throws java.lang.Exception
Checks a property for all elements in a list.

Parameters:
list - List Data model
property - The check property
filter - the row filter
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getCheckedItems

public static java.util.Map getCheckedItems(ListDataModel list)
                                     throws java.lang.Exception
Returns an Array including all the matching row beans of the list. Therefore the elements in the list must implement the checkabel interface. Only the checked items (1) will be returned!

Parameters:
list - The list
Returns:
a Hashtable including the checked elements
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getCheckedItems

public static java.util.Map getCheckedItems(ListDataModel list,
                                            java.lang.String property)
                                     throws java.lang.Exception
Returns an Array including all the matching row beans in a list. Only the checked items (1) will be returned!

Parameters:
list - The list
property - The check property
Returns:
a Hashtable including the checked elements
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getUncheckedItems

public static java.util.Map getUncheckedItems(ListDataModel list)
                                       throws java.lang.Exception
Returns an Array including all the matching row beans of the list. Therefore the elements in the list must implement the checkabel interface. Only the unchecked items (0) will be returned!

Parameters:
list - The list
Returns:
a Hashtable including the unchecked elements
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getUncheckedItems

public static java.util.Map getUncheckedItems(ListDataModel list,
                                              java.lang.String property)
                                       throws java.lang.Exception
Returns an Array including all the matching row beans of the list. Only the unchecked items (0) will be returned!

Parameters:
list - The list
property - The check property
Returns:
a Hashtable including the unchecked elements
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getItemsByState

public static java.util.Map getItemsByState(ListDataModel list,
                                            CheckState state)
                                     throws java.lang.Exception
Returns a collection for all element in the list which fits the specified check state. Therefore the elements in the list must implement the checkabel interface.

Parameters:
list - The list which includes the checked elements
state - The check state
Returns:
a Hashtable including the row beans
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm

getItemsByState

public static java.util.Map getItemsByState(ListDataModel list,
                                            java.lang.String property,
                                            CheckState state)
                                     throws java.lang.Exception
Returns a collection for all element in the list which fits the specified check state.

Parameters:
list - The list which includes the checked elements
property - The check property
state - The check state
Returns:
a Hashtable including the row beans
Throws:
java.lang.Exception - Indicates an error while iterating and executing the algorithm


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.