Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.grid
Class GridCellElement<P extends GISPrimitive>
- java.lang.Object
-
- org.arakhne.afc.gis.grid.GridCellElement<P>
-
- Type Parameters:
P- is the type of the user data inside the node.
- All Implemented Interfaces:
Comparable<GridCellElement<P>>
class GridCellElement<P extends GISPrimitive> extends Object implements Comparable<GridCellElement<P>>
Element inside a grid cell.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- See Also:
GISPrimitive- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Constructor Summary
Constructors Constructor Description GridCellElement(P element)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddCellLink(GridCell<P> cell)Add a reference from this element to a cell that is containing this element.intcompareTo(GridCellElement<P> obj)List<GridCell<P>>consumeCells()Replies the cell on which the given element is located.booleanequals(Object obj)Pget()Replies the element.inthashCode()booleanisReferenceCell(GridCell<P> cell)Replies if the specified cell is the reference cell for the element.booleanremoveCellLink(GridCell<P> cell)Add a reference from this element to a cell that is containing this element.StringtoString()
-
-
-
Constructor Detail
-
GridCellElement
GridCellElement(P element)
Constructor.- Parameters:
element- the element.
-
-
Method Detail
-
addCellLink
public boolean addCellLink(GridCell<P> cell)
Add a reference from this element to a cell that is containing this element.- Parameters:
cell- the grid cell.- Returns:
trueif the added cell is the reference;falseif the added cell is not the reference.
-
removeCellLink
public boolean removeCellLink(GridCell<P> cell)
Add a reference from this element to a cell that is containing this element.- Parameters:
cell- the grid cell.- Returns:
trueif the removed cell is the reference;falseif the removed cell is not the reference.
-
consumeCells
public List<GridCell<P>> consumeCells()
Replies the cell on which the given element is located. The cell links were removed from the element.- Returns:
- a copy of the cells.
-
isReferenceCell
@Pure public boolean isReferenceCell(GridCell<P> cell)
Replies if the specified cell is the reference cell for the element. The reference cell is the cell where the element is supported to be attached when it is supposed by be inside only one cell.- Parameters:
cell- is the cell to test- Returns:
trueif the specified cell is the reference cell;falseotherwise.
-
get
@Pure public P get()
Replies the element.- Returns:
- the element.
-
compareTo
@Pure public int compareTo(GridCellElement<P> obj)
- Specified by:
compareToin interfaceComparable<P extends GISPrimitive>
-
-