de.dfki.lt.mary.unitselection.cart
Class LeafNode.FloatLeafNode

java.lang.Object
  extended by de.dfki.lt.mary.unitselection.cart.Node
      extended by de.dfki.lt.mary.unitselection.cart.LeafNode
          extended by de.dfki.lt.mary.unitselection.cart.LeafNode.FloatLeafNode
Enclosing class:
LeafNode

public static class LeafNode.FloatLeafNode
extends LeafNode

A leaf class that is suitable for regression trees. Here, a leaf consists of a mean and a standard deviation.

Author:
marc

Nested Class Summary
 
Nested classes/interfaces inherited from class de.dfki.lt.mary.unitselection.cart.LeafNode
LeafNode.FeatureVectorLeafNode, LeafNode.FloatLeafNode, LeafNode.IntAndFloatArrayLeafNode, LeafNode.IntArrayLeafNode
 
Field Summary
 
Fields inherited from class de.dfki.lt.mary.unitselection.cart.Node
isRoot, mother, nodeIndex
 
Constructor Summary
LeafNode.FloatLeafNode(float[] data)
           
 
Method Summary
protected  void fillData(java.lang.Object target, int pos, int len)
          Write this node's data into the target object at pos, making sure that exactly len data are written.
 java.lang.Object getAllData()
          Get all data in this leaf
 int getNumberOfData()
          Count all the data available at and below this node.
 java.lang.String toString()
           
 void toWagonFormat(java.io.DataOutputStream out, java.lang.String extension, java.io.PrintWriter pw)
          Writes the Cart to the given DataOut in Wagon Format
 
Methods inherited from class de.dfki.lt.mary.unitselection.cart.LeafNode
getDecisionPath, getNextLeafNode, getNumberOfNodes
 
Methods inherited from class de.dfki.lt.mary.unitselection.cart.Node
getMother, getNodeIndex, getRootNode, isRoot, setIsRoot, setMother, setNodeIndex, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LeafNode.FloatLeafNode

public LeafNode.FloatLeafNode(float[] data)
Method Detail

getAllData

public java.lang.Object getAllData()
Get all data in this leaf

Specified by:
getAllData in class LeafNode
Returns:
the mean/standard deviation value contained in this leaf

fillData

protected void fillData(java.lang.Object target,
                        int pos,
                        int len)
Description copied from class: LeafNode
Write this node's data into the target object at pos, making sure that exactly len data are written. The type of data written depends on the type of nodes; for example, when IntArrayLeafNodes are used, target would be an int[].

Specified by:
fillData in class LeafNode
pos - the position in the target at which to start writing
len - the amount of data items to write, usually equals getNumberOfData().

getNumberOfData

public int getNumberOfData()
Description copied from class: LeafNode
Count all the data available at and below this node. The meaning of this depends on the type of nodes; for example, when IntArrayLeafNodes are used, it is the total number of ints that are saved in all leaf nodes below the current node.

Specified by:
getNumberOfData in class LeafNode
Returns:
an int counting the data below the current node, or -1 if such a concept is not meaningful.

toWagonFormat

public void toWagonFormat(java.io.DataOutputStream out,
                          java.lang.String extension,
                          java.io.PrintWriter pw)
                   throws java.io.IOException
Writes the Cart to the given DataOut in Wagon Format

Specified by:
toWagonFormat in class Node
Parameters:
out - the outputStream
extension - the extension that is added to the last daughter
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object