Package org.geotools.grid.hexagon
Class HexagonBuilder
- Object
- 
- PolygonBuilder
- 
- HexagonBuilder
 
 
- 
 public class HexagonBuilder extends PolygonBuilder Used byHexagonsclass to build grids.- Since:
- 2.7
- Author:
- mbedward
 
- 
- 
Field Summary- 
Fields inherited from class PolygonBuildergridBounds
 
- 
 - 
Constructor SummaryConstructors Constructor Description HexagonBuilder(ReferencedEnvelope gridBounds, double sideLen, HexagonOrientation orientation)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HexagoncreateNeighbor(PolygonElement el, Neighbor neighbor)Creates a newHexagonpositioned at the given neighbor position relative to the reference element.PolygonElementgetFirstElement()PolygonElementgetNextXElement(PolygonElement el)PolygonElementgetNextYElement(PolygonElement el)booleanisValidDenseVertexSpacing(double v)booleanisValidNeighbor(Neighbor neighbor)Tests whether a neighbor position is valid for a given orientation.- 
Methods inherited from class PolygonBuilderbuildGrid
 
- 
 
- 
- 
- 
Constructor Detail- 
HexagonBuilderpublic HexagonBuilder(ReferencedEnvelope gridBounds, double sideLen, HexagonOrientation orientation) 
 
- 
 - 
Method Detail- 
isValidNeighborpublic boolean isValidNeighbor(Neighbor neighbor) Tests whether a neighbor position is valid for a given orientation. Since theHexagonclass is intended to work within a grid (ie. a perfect tesselation) some combinations of neighbour position and hexagon orientation are invalid. For example, aFLAThexagon does not have aLEFT, rather it hasUPPER_LEFTandLOWER_LEFT.- Specified by:
- isValidNeighborin class- PolygonBuilder
- Parameters:
- neighbor- neighbor position
- Returns:
- trueif the combination is valid;- falseotherwise
 
 - 
createNeighborpublic Hexagon createNeighbor(PolygonElement el, Neighbor neighbor) Creates a newHexagonpositioned at the given neighbor position relative to the reference element.- Specified by:
- createNeighborin class- PolygonBuilder
- Parameters:
- el- the reference hexagon
- neighbor- a valid neighbour position given the reference hexagon's orientation
- Returns:
- a new Hexagonobject
- Throws:
- IllegalArgumentException- if either argument is- nullor if- elis not an instance of- Hexagonor if the neighbor position is not valid for the reference hexagon's orientation
- See Also:
- #isValidNeighbor(Hexagon.Orientation, Hexagon.Neighbor)
 
 - 
getFirstElementpublic PolygonElement getFirstElement() - Specified by:
- getFirstElementin class- PolygonBuilder
 
 - 
getNextXElementpublic PolygonElement getNextXElement(PolygonElement el) - Specified by:
- getNextXElementin class- PolygonBuilder
 
 - 
getNextYElementpublic PolygonElement getNextYElement(PolygonElement el) - Specified by:
- getNextYElementin class- PolygonBuilder
 
 - 
isValidDenseVertexSpacingpublic boolean isValidDenseVertexSpacing(double v) - Specified by:
- isValidDenseVertexSpacingin class- PolygonBuilder
 
 
- 
 
-