hhreco.fragmentation
Class FitData

java.lang.Object
  extended byhhreco.fragmentation.FitData

public class FitData
extends java.lang.Object

A data structure storing a set of bases that represents a particular fragmentation of a symbol.


Constructor Summary
FitData(Basis[] bases, int[] strokeIndices, int nstrokes)
          Each basis correspond to a stroke index.
 
Method Summary
 Basis getBasis(int i)
          Return the basis at the specified index.
 int getBasisCount()
          Return the number of bases in this fitting.
 int[] getBreakpointsOnStroke(int i)
          Return the breakpoints on the specified stroke (by stroke index).
 Basis[] getFitsOnStroke(int i)
          Return the bases on the specified stroke.
 int getNumStrokes()
          Return the number of strokes of the original shape that this fitting approximates.
 int getStrokeIndex(int i)
          Return the stroke index that the basis at the specified index corresponds to.
 java.lang.String getTemplate()
          Return the template of this fit.
 double getTotalFitError()
          Return the sum of the fit errors from all bases.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FitData

public FitData(Basis[] bases,
               int[] strokeIndices,
               int nstrokes)
Each basis correspond to a stroke index. There can be more than 1 basis per stroke if break points exist in the stroke. 'nstrokes' is the number of strokes in the original shape.

Method Detail

getBasisCount

public int getBasisCount()
Return the number of bases in this fitting.


getBasis

public Basis getBasis(int i)
Return the basis at the specified index.


getStrokeIndex

public int getStrokeIndex(int i)
Return the stroke index that the basis at the specified index corresponds to.


getTotalFitError

public double getTotalFitError()
Return the sum of the fit errors from all bases.


getTemplate

public java.lang.String getTemplate()
Return the template of this fit. 'L' for a linear basis and 'E' for an elliptical basis.


getNumStrokes

public int getNumStrokes()
Return the number of strokes of the original shape that this fitting approximates.


getBreakpointsOnStroke

public int[] getBreakpointsOnStroke(int i)
Return the breakpoints on the specified stroke (by stroke index). Null if non exists.


getFitsOnStroke

public Basis[] getFitsOnStroke(int i)
Return the bases on the specified stroke. Null if non exists.


toString

public java.lang.String toString()