kylm.model.ngram
Class BranchNode

java.lang.Object
  extended by kylm.model.ngram.NgramNode
      extended by kylm.model.ngram.BranchNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<NgramNode>

public final class BranchNode
extends NgramNode

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class kylm.model.ngram.NgramNode
NgramNode.NgramNodeIdComparator
 
Field Summary
 
Fields inherited from class kylm.model.ngram.NgramNode
ADD_BRANCH, ADD_LEAF, ADD_NONE, TRIM_SCORE
 
Constructor Summary
BranchNode(int id, NgramNode parent)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 float getBackoffScore()
           
 NgramNode getChild(int id, int add)
          Get a child from the child vector.
 int getChildCount()
           
 boolean hasChildren()
          Return whether this node has children or not
 java.util.Iterator<NgramNode> iterator()
           
 void setBackoffScore(float backoff)
           
 void setChildren(java.util.Vector<NgramNode> newChildren)
           
 void setChildrenSize(int size)
           
 
Methods inherited from class kylm.model.ngram.NgramNode
getChild, getCount, getFallback, getId, getParent, getScore, incrementCount, setCount, setId, setParent, setScore
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BranchNode

public BranchNode(int id,
                  NgramNode parent)
Method Detail

getChild

public NgramNode getChild(int id,
                          int add)
Description copied from class: NgramNode
Get a child from the child vector. If add is true and no child exists, add one. If add is false and no child exists, return null.

Overrides:
getChild in class NgramNode
Parameters:
id - The id of the child to find.
add - Whether or not to add the child if it exists.
Returns:
The child.

hasChildren

public boolean hasChildren()
Description copied from class: NgramNode
Return whether this node has children or not

Overrides:
hasChildren in class NgramNode

getBackoffScore

public float getBackoffScore()
Overrides:
getBackoffScore in class NgramNode

setBackoffScore

public void setBackoffScore(float backoff)
Overrides:
setBackoffScore in class NgramNode

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class NgramNode

setChildren

public void setChildren(java.util.Vector<NgramNode> newChildren)
Overrides:
setChildren in class NgramNode

setChildrenSize

public void setChildrenSize(int size)

iterator

public java.util.Iterator<NgramNode> iterator()
Specified by:
iterator in interface java.lang.Iterable<NgramNode>
Overrides:
iterator in class NgramNode

getChildCount

public int getChildCount()
Overrides:
getChildCount in class NgramNode