org.palo.api
Interface SubsetState

All Known Implementing Classes:
AbstractSubsetState, FlatState, HierarchicalState, RegExState

Deprecated. old subset definitions are no longer supported. Please use Subset2 and its SubsetFilter instead

public interface SubsetState

A SubsetState defines the visible Elements of a Subset. Those elements are either enumerated or determined by an expression, e.g. a regular expression. To support arbitrary defined hierarchies of elements it is possible to define several paths for each visible element. A path describes the location of a visible element and usually consists of a comma separated list of element identifiers. However, since a path is of type String applications may use and store a different location description, but should not use a colon since it is used as path delimiter.

Version:
$Id: SubsetState.html,v 1.19 2009/07/09 11:01:46 ArndHouben Exp $

Method Summary
 void addPath(Element element, java.lang.String path)
          Deprecated. Adds the specified path for the given visible element
 void addVisibleElement(Element element, int position)
          Deprecated. Adds the given element to the list of all visible elements.
 void addVisibleElment(Element element)
          Deprecated. Adds the given element to the list of all visible elements
 boolean containsPath(Element element, java.lang.String path)
          Deprecated. Checks if this SubsetState contains the specified path for the given Element
 java.lang.String getExpression()
          Deprecated. Returns an optional expression to determine the visible elements
 java.lang.String getId()
          Deprecated. Returns the unique state id.
 java.lang.String getName()
          Deprecated. Returns an optional name for the state.
 java.lang.String[] getPaths(Element element)
          Deprecated. Returns all paths for the given Element or null, if no paths were defined.
 int[] getPositions(Element element)
          Deprecated. Returns the positions of the given visible element.
 Attribute getSearchAttribute()
          Deprecated. Returns an attribute field that is used for searching with the regular expression.
 Element[] getVisibleElements()
          Deprecated. Returns all visible elements.
 boolean isVisible(Element element)
          Deprecated. Checks if the given Element is visible within this SubsetState.
 void removeAllVisibleElements()
          Deprecated. Convenience method to remove all visible elements
 void removePath(Element element, java.lang.String path)
          Deprecated. Removes the specified path for the given visible element.
 void removeVisibleElement(Element element)
          Deprecated. Removes the given element from the list of all visible elements
 void setExpression(java.lang.String expression)
          Deprecated. Sets an expression to determine the visible elements
 void setName(java.lang.String name)
          Deprecated. Sets an optional name, label or description
 void setSearchAttribute(Attribute searchAttribute)
          Deprecated. Sets the attribute field that is used instead of the element name when filtering with a regular expression
 

Method Detail

getId

java.lang.String getId()
Deprecated. 
Returns the unique state id.

Returns:
the state id.

getName

java.lang.String getName()
Deprecated. 
Returns an optional name for the state.

Returns:
the state name or null if none was set

setName

void setName(java.lang.String name)
Deprecated. 
Sets an optional name, label or description

Parameters:
name - a human readable label

getExpression

java.lang.String getExpression()
Deprecated. 
Returns an optional expression to determine the visible elements

Returns:
the state expression or null if none was set

setExpression

void setExpression(java.lang.String expression)
Deprecated. 
Sets an expression to determine the visible elements

Parameters:
expression - a state expression to describe the visible elements

getSearchAttribute

Attribute getSearchAttribute()
Deprecated. 
Returns an attribute field that is used for searching with the regular expression.

Returns:
the state search attribute field or null if none was set

setSearchAttribute

void setSearchAttribute(Attribute searchAttribute)
Deprecated. 
Sets the attribute field that is used instead of the element name when filtering with a regular expression

Parameters:
searchAttribute - field used for filtering

getVisibleElements

Element[] getVisibleElements()
Deprecated. 
Returns all visible elements.

Note: the array could be empty but that does not necessarily mean that no element is visible because an expression can determine the elements too.

Returns:
the visible elements

addVisibleElment

void addVisibleElment(Element element)
Deprecated. 
Adds the given element to the list of all visible elements

Parameters:
element - the element to show

addVisibleElement

void addVisibleElement(Element element,
                       int position)
Deprecated. 
Adds the given element to the list of all visible elements. The position parameter can be used to store additional information about the element position.

Parameters:
element - the element to show
position - an element position

removeVisibleElement

void removeVisibleElement(Element element)
Deprecated. 
Removes the given element from the list of all visible elements

Parameters:
element - the element to remove

removeAllVisibleElements

void removeAllVisibleElements()
Deprecated. 
Convenience method to remove all visible elements


getPaths

java.lang.String[] getPaths(Element element)
Deprecated. 
Returns all paths for the given Element or null, if no paths were defined. An element path consists of a comma separated list of element ids. Since an element can be referenced several times, multiple paths are possible.

Parameters:
element - a visible element
Returns:
all existing element paths or null

addPath

void addPath(Element element,
             java.lang.String path)
Deprecated. 
Adds the specified path for the given visible element

Parameters:
element - a visible element
path - a path to the visible element

containsPath

boolean containsPath(Element element,
                     java.lang.String path)
Deprecated. 
Checks if this SubsetState contains the specified path for the given Element

Parameters:
element - a visible element
path - a valid path to the visible element
Returns:
true if the path is known for the given element, false otherwise

removePath

void removePath(Element element,
                java.lang.String path)
Deprecated. 
Removes the specified path for the given visible element.

Parameters:
element - a visible element
path - the path to remove

getPositions

int[] getPositions(Element element)
Deprecated. 
Returns the positions of the given visible element. This is useful if subset defines no hierarchy but contains same element several times.

Parameters:
element - a visible element
Returns:
its positions

isVisible

boolean isVisible(Element element)
Deprecated. 
Checks if the given Element is visible within this SubsetState.

Parameters:
element - the Element to check
Returns:
true if it is visible, false otherwise