flattree.process
Class State

java.lang.Object
  extended by flattree.process.State

public class State
extends Object

The state of a Node and its Leafs while it is being processed.

See Also:
Node.read(flattree.flat.ReadLine, State), Node.write(flattree.flat.WriteLine, State)

Constructor Summary
State()
          Create an empty state.
State(Map<String,String> values)
          Create state from the given values.
State(String name, String value)
          Convenience constructor for a single value.
 
Method Summary
 void clear()
          Clear this state.
 Range getRange()
          Get the range for the Node in the FlatReader or FlatWriter.
 Range getRange(Leaf leaf)
          Get the range for the given Leaf in the FlatReader or FlatWriter.
 String getValue(String name)
          Get the value for the given name.
 Map<String,String> getValues()
          Get all values.
 void putValue(String name, String value)
          Put the given value in this state.
 void setRange(int from, int to)
          Set the range for the Node in the FlatReader or FlatWriter.
 void setRange(Leaf leaf, int from, int to)
          Set the range for the given Leaf in the FlatReader or FlatWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Create an empty state.


State

public State(Map<String,String> values)
Create state from the given values.

Parameters:
values - initial state

State

public State(String name,
             String value)
Convenience constructor for a single value.

Parameters:
name - name of value
value - value
Method Detail

clear

public void clear()
Clear this state.


putValue

public void putValue(String name,
                     String value)
Put the given value in this state.

Parameters:
name - name of value
value - value

getValue

public String getValue(String name)
Get the value for the given name.

Parameters:
name - name to get value
Returns:
value

setRange

public void setRange(int from,
                     int to)
Set the range for the Node in the FlatReader or FlatWriter.

Parameters:
from - range start index
to - range end index

getRange

public Range getRange()
Get the range for the Node in the FlatReader or FlatWriter.

Returns:
range

setRange

public void setRange(Leaf leaf,
                     int from,
                     int to)
Set the range for the given Leaf in the FlatReader or FlatWriter.

Parameters:
from - range start index
to - range end index

getRange

public Range getRange(Leaf leaf)
Get the range for the given Leaf in the FlatReader or FlatWriter.

Returns:
range

getValues

public Map<String,String> getValues()
Get all values.

Returns:
values


Copyright © 2011. All Rights Reserved.