org.shapelogic.polygon
Class PolygonAnnotator

java.lang.Object
  extended by org.shapelogic.polygon.PolygonAnnotator
All Implemented Interfaces:
Calc0<Polygon>, CalcInvoke<Polygon>, CalcValue<Polygon>, LazyCalc<Polygon>, Improver<Polygon>, ObjectAnnotator<Polygon>

public class PolygonAnnotator
extends java.lang.Object
implements ObjectAnnotator<Polygon>

Not this functionality is in ChainCodeHandler But this is interesting on its own, now there are no annotation going on, I need to move this in too

Author:
Sami Badawi

Constructor Summary
PolygonAnnotator()
           
PolygonAnnotator(Polygon calcValue)
           
 
Method Summary
 boolean createdNewVersion()
           
 void findJunctions()
           
 Polygon getInput()
           
 Polygon getValue()
          Starts a lazy calculation.
 Polygon 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(Polygon 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

PolygonAnnotator

public PolygonAnnotator()

PolygonAnnotator

public PolygonAnnotator(Polygon calcValue)
Method Detail

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<Polygon>

createdNewVersion

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

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<Polygon>

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<Polygon>

invoke

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

getValue

public Polygon 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<Polygon>

findJunctions

public void findJunctions()

getInput

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

setInput

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


Copyright © 2009. All Rights Reserved.