net.groboclown.xml.xdstates.v1.modules
Class ACount
java.lang.Object
|
+--net.groboclown.xml.xdstates.v1.modules.ACount
- All Implemented Interfaces:
- IAttributeModule
- public class ACount
- extends Object
- implements IAttributeModule
This module counts between a range specified in the value, where the
separator character is a colon (':'), in the format
"start:end"
, where start is the first value
to use, and end is the last value to end on. If you don't specify one
of the numbers, it is assumed that the given number is the end, and
the start is "1". The counted number will be inserted as an Item
at the end of the list. If a third value is specified, that is the increment
amount, which is by default "1".
- Version:
- Alpha 0.9.0 - JDK 1.0+
- Author:
- Matt Albrecht
Field Summary |
(package private) int |
count
|
(package private) boolean |
hasMore
|
(package private) boolean |
started
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
started
boolean started
hasMore
boolean hasMore
count
int count
ACount
public ACount()
registerValueModule
public void registerValueModule(IValueModule module)
- Register the given value module with this module. The attribute
module does not have to accept the module, and can throw an
IllegalArgumentException if it is incorrect.
- Specified by:
registerValueModule
in interface IAttributeModule
copy
public IAttributeModule copy()
- Copy the current module, and reset the new module's state as if
fire( String, IDataList )
has never been called.
- Specified by:
copy
in interface IAttributeModule
hasAnotherState
public boolean hasAnotherState()
- The containing application will ensure that this will only be called
after each
fire( String, IDataList )
call. The
fire( String, IDataList )
call should
store this result at the end of the fire( String, IDataList )
method.
- Specified by:
hasAnotherState
in interface IAttributeModule
- Returns:
- true if this attribute knows of another state
to transform the inner data.
- See Also:
fire( String, IDataList )
shouldFireTreeParse
public boolean shouldFireTreeParse(String value,
IDataList list)
- Determines if the tree at the node in the list should be fired.
At the point this is called, the list contains no IItems. If any
attribute returns false, then the tree and its sub-nodes
are not fired. However, if all the attributes return true
from this method, then the tree and its sub-nodes are fired.
This is useful for performing conditional branching on a
tree to prevent the sub-nodes for executing any actions which
may be undesired (such as property adjustments).
- Specified by:
shouldFireTreeParse
in interface IAttributeModule
fire
public IDataList fire(String value,
IDataList list)
- Perform the specific permutation of the given data list. The
implementation must store the state of the next
hasAnotherState()
at the end of this method.
- Specified by:
fire
in interface IAttributeModule
- Returns:
- the new list after the attribute performs its modifications.
Written under the LGPL