Class Node
- java.lang.Object
-
- org.hortonmachine.gears.libs.modules.Node
-
-
Field Summary
Fields Modifier and Type Field Description intcolintcolsprotected doubledoubleNovalueprotected floatfloatNovalueprotected javax.media.jai.iterator.RandomItergridIterprotected intintNovalueprotected booleanisValidintrowintrowsprotected booleantouchesBoundprotected booleantouchesNovalue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDoubleValueFromMap(javax.media.jai.iterator.RandomIter map)Get the double value of another map in the current node position.floatgetFloatValueFromMap(javax.media.jai.iterator.RandomIter map)Get the float value of another map in the current node position.intgetIntValueFromMap(javax.media.jai.iterator.RandomIter map)Get the int value of another map in the current node position.doublegetValueFromMap(javax.media.jai.iterator.RandomIter map)Get the value from a map.booleanisValid()Checks if the node is valid.voidsetDoubleValueInMap(javax.media.jai.iterator.WritableRandomIter map, double value)voidsetFloatValueInMap(javax.media.jai.iterator.WritableRandomIter map, float value)Utility method to set the value of a certain map in the current node position.voidsetIntValueInMap(javax.media.jai.iterator.WritableRandomIter map, int value)voidsetValueInMap(javax.media.jai.iterator.WritableRandomIter map, double value)booleantouchesBound()booleantouchesNovalue()
-
-
-
Field Detail
-
row
public final int row
-
col
public final int col
-
cols
public final int cols
-
rows
public final int rows
-
isValid
protected boolean isValid
-
touchesBound
protected boolean touchesBound
-
touchesNovalue
protected boolean touchesNovalue
-
gridIter
protected final javax.media.jai.iterator.RandomIter gridIter
-
doubleNovalue
protected double doubleNovalue
-
floatNovalue
protected float floatNovalue
-
intNovalue
protected int intNovalue
-
-
Constructor Detail
-
Node
public Node(javax.media.jai.iterator.RandomIter gridIter, int cols, int rows, int col, int row, Double novalue)
-
-
Method Detail
-
getValueFromMap
public double getValueFromMap(javax.media.jai.iterator.RandomIter map)
Get the value from a map. Default to getting a double value.- Parameters:
map- the map to read from.- Returns:
- the float value read.
-
getFloatValueFromMap
public float getFloatValueFromMap(javax.media.jai.iterator.RandomIter map)
Get the float value of another map in the current node position.- Parameters:
map- the map from which to get the value.- Returns:
- the float value or a novalue.
-
getIntValueFromMap
public int getIntValueFromMap(javax.media.jai.iterator.RandomIter map)
Get the int value of another map in the current node position.- Parameters:
map- the map from which to get the value.- Returns:
- the int value or a novalue.
-
getDoubleValueFromMap
public double getDoubleValueFromMap(javax.media.jai.iterator.RandomIter map)
Get the double value of another map in the current node position.- Parameters:
map- the map from which to get the value.- Returns:
- the double value or a novalue.
-
setValueInMap
public void setValueInMap(javax.media.jai.iterator.WritableRandomIter map, double value)
-
setFloatValueInMap
public void setFloatValueInMap(javax.media.jai.iterator.WritableRandomIter map, float value)Utility method to set the value of a certain map in the current node position.- Parameters:
map- the map to set the value in. ifnull, it is ignored.value- the value to set.
-
setIntValueInMap
public void setIntValueInMap(javax.media.jai.iterator.WritableRandomIter map, int value)
-
setDoubleValueInMap
public void setDoubleValueInMap(javax.media.jai.iterator.WritableRandomIter map, double value)
-
isValid
public boolean isValid()
Checks if the node is valid.A node is valid if
- it is placed inside the raster bounds
- its value is not novalue
- Returns:
trueif the node is valid.
-
touchesBound
public boolean touchesBound()
- Returns:
trueif this node touches a boundary.
-
touchesNovalue
public boolean touchesNovalue()
- Returns:
trueif this node touches a novalue.
-
-