flattree.tree
Class ConstantLeaf

java.lang.Object
  extended by flattree.tree.AbstractLeaf
      extended by flattree.tree.ConstantLeaf
All Implemented Interfaces:
Leaf

public class ConstantLeaf
extends AbstractLeaf

A Leaf writing/reading constant characters without value in the tree.

See Also:
setConstant(String)

Field Summary
 
Fields inherited from interface flattree.tree.Leaf
REQUIRED
 
Constructor Summary
ConstantLeaf()
           
ConstantLeaf(String constant)
           
 
Method Summary
 String getConstant()
          Get the constant.
protected  boolean readImpl(ReadLine line, State state)
          Reads the constant.
 void setConstant(String constant)
          Set the constant.
protected  void writeImpl(WriteLine line, State state)
          Writes the constant.
 
Methods inherited from class flattree.tree.AbstractLeaf
getThrowOnRead, read, setThrowOnRead, throwOnRead, throwOnRead, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantLeaf

public ConstantLeaf()

ConstantLeaf

public ConstantLeaf(String constant)
Method Detail

getConstant

public String getConstant()
Get the constant.

Returns:
constant

setConstant

public void setConstant(String constant)
Set the constant.

Parameters:
constant -

writeImpl

protected void writeImpl(WriteLine line,
                         State state)
Writes the constant.

Specified by:
writeImpl in class AbstractLeaf
See Also:
setConstant(String)

readImpl

protected boolean readImpl(ReadLine line,
                           State state)
Reads the constant.

Specified by:
readImpl in class AbstractLeaf
Throws:
TreeException - if read characters don't equal the configured constant


Copyright © 2011. All Rights Reserved.