org.shapelogic.imageprocessing
Class CircleFinder

java.lang.Object
  extended by org.shapelogic.imageprocessing.CircleFinder
All Implemented Interfaces:
Calc0<MultiLine>, CalcInvoke<MultiLine>, CalcValue<MultiLine>, LazyCalc<MultiLine>, Improver<MultiLine>, ObjectAnnotator<MultiLine>

public class CircleFinder
extends java.lang.Object
implements ObjectAnnotator<MultiLine>

Class that can find a circle in MultiLine. If it find a circle it will annotate the MultiLine as a circle and set the circle center What is the input and output? I think that it should take a circle This class do not really need a state so I build a state for no good reason Should this still implement ShapeAnnotator or just have a static method? I think that if I need to register a lot of them, then they need to implement an interface.

Author:
Sami Badawi

Constructor Summary
CircleFinder()
           
CircleFinder(MultiLine input)
           
 
Method Summary
 boolean createdNewVersion()
           
static boolean findAnnotations(MultiLine multiLine)
          For this no state is needed, so this does not build the state
 MultiLine getInput()
           
 MultiLine getValue()
          Starts a lazy calculation.
 MultiLine invoke()
           
 boolean isAnnotationsFound()
          Try if there is anything that can be annotated.
 boolean isDirty()
          When dirty is false that means that the calculated value can be used
 void setInput(MultiLine input)
           
 void setup()
          Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CircleFinder

public CircleFinder()

CircleFinder

public CircleFinder(MultiLine input)
Method Detail

findAnnotations

public static boolean findAnnotations(MultiLine multiLine)
For this no state is needed, so this does not build the state

Returns:
true if a circle was found

createdNewVersion

public boolean createdNewVersion()
Specified by:
createdNewVersion in interface Improver<MultiLine>

getInput

public MultiLine getInput()
Specified by:
getInput in interface Improver<MultiLine>

isDirty

public boolean isDirty()
Description copied from interface: LazyCalc
When dirty is false that means that the calculated value can be used

Specified by:
isDirty in interface LazyCalc<MultiLine>

setup

public void setup()
Description copied from interface: LazyCalc
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better.

Specified by:
setup in interface LazyCalc<MultiLine>

invoke

public MultiLine invoke()
Specified by:
invoke in interface Calc0<MultiLine>

getValue

public MultiLine getValue()
Description copied from interface: CalcValue
Starts a lazy calculation. If dirty do calc() else return cached value. This should maybe be moved up in the hierarchy

Specified by:
getValue in interface CalcValue<MultiLine>

isAnnotationsFound

public boolean isAnnotationsFound()
Description copied from interface: ObjectAnnotator
Try if there is anything that can be annotated. return true if there is.

Specified by:
isAnnotationsFound in interface ObjectAnnotator<MultiLine>

setInput

public void setInput(MultiLine input)
Specified by:
setInput in interface Improver<MultiLine>


Copyright © 2008. All Rights Reserved.