|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.geometry.iso.topograph2D.IntersectionMatrix
public class IntersectionMatrix
A Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. This class can used to represent both computed DE-9IM's (like 212FF1FF2) as well as patterns for matching them (like T*T******).
Methods are provided to:
For a description of the DE-9IM, see the OpenGIS Simple Features Specification for SQL .
Constructor Summary | |
---|---|
IntersectionMatrix()
Creates an IntersectionMatrix with FALSE
dimension values. |
|
IntersectionMatrix(IntersectionMatrix other)
Creates an IntersectionMatrix with the same elements as
other . |
|
IntersectionMatrix(java.lang.String elements)
Creates an IntersectionMatrix with the given dimension
symbols. |
Method Summary | |
---|---|
void |
add(IntersectionMatrix im)
Adds one matrix to another. |
int |
get(int row,
int column)
Returns the value of one of this IntersectionMatrix s
elements. |
static boolean |
matches(int actualDimensionValue,
char requiredDimensionSymbol)
Returns true if the dimension value satisfies the dimension symbol. |
boolean |
matches(java.lang.String requiredDimensionSymbols)
Returns whether the elements of this IntersectionMatrix
satisfies the required dimension symbols. |
static boolean |
matches(java.lang.String actualDimensionSymbols,
java.lang.String requiredDimensionSymbols)
Returns true if each of the actual dimension symbols satisfies the corresponding required dimension symbol. |
void |
set(int row,
int column,
int dimensionValue)
Changes the value of one of this IntersectionMatrix s
elements. |
void |
set(java.lang.String dimensionSymbols)
Changes the elements of this IntersectionMatrix to the
dimension symbols in dimensionSymbols . |
void |
setAll(int dimensionValue)
Changes the elements of this IntersectionMatrix to
dimensionValue . |
void |
setAtLeast(int row,
int column,
int minimumDimensionValue)
Changes the specified element to minimumDimensionValue if
the element is less. |
void |
setAtLeast(java.lang.String minimumDimensionSymbols)
For each element in this IntersectionMatrix , changes the
element to the corresponding minimum dimension symbol if the element is
less. |
void |
setAtLeastIfValid(int row,
int column,
int minimumDimensionValue)
If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue if the element is less. |
java.lang.String |
toString()
Returns a nine-character String representation of this
IntersectionMatrix . |
IntersectionMatrix |
transpose()
Transposes this IntersectionMatrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntersectionMatrix()
IntersectionMatrix
with FALSE
dimension values.
public IntersectionMatrix(java.lang.String elements)
IntersectionMatrix
with the given dimension
symbols.
elements
- a String of nine dimension symbols in row major orderpublic IntersectionMatrix(IntersectionMatrix other)
IntersectionMatrix
with the same elements as
other
.
other
- an IntersectionMatrix
to copyMethod Detail |
---|
public void add(IntersectionMatrix im)
im
- the matrix to addpublic static boolean matches(int actualDimensionValue, char requiredDimensionSymbol)
actualDimensionValue
- a number that can be stored in the
IntersectionMatrix
. Possible values are
{TRUE, FALSE, DONTCARE, 0, 1, 2}
.requiredDimensionSymbol
- a character used in the string representation of an
IntersectionMatrix
. Possible values are
{T, F, * , 0, 1, 2}
.
public static boolean matches(java.lang.String actualDimensionSymbols, java.lang.String requiredDimensionSymbols)
actualDimensionSymbols
- nine dimension symbols to validate. Possible values are
{T, F, * , 0, 1, 2}
.requiredDimensionSymbols
- nine dimension symbols to validate against. Possible values
are {T, F, * , 0, 1, 2}
.
public void set(int row, int column, int dimensionValue)
IntersectionMatrix
s
elements.
row
- the row of this IntersectionMatrix
, indicating
the interior, boundary or exterior of the first
Geometry
column
- the column of this IntersectionMatrix
,
indicating the interior, boundary or exterior of the second
Geometry
dimensionValue
- the new value of the elementpublic void set(java.lang.String dimensionSymbols)
IntersectionMatrix
to the
dimension symbols in dimensionSymbols
.
dimensionSymbols
- nine dimension symbols to which to set this
IntersectionMatrix
s elements. Possible values
are {T, F, * , 0, 1, 2}
public void setAtLeast(int row, int column, int minimumDimensionValue)
minimumDimensionValue
if
the element is less.
row
- the row of this IntersectionMatrix
, indicating
the interior, boundary or exterior of the first
Geometry
column
- the column of this IntersectionMatrix
,
indicating the interior, boundary or exterior of the second
Geometry
minimumDimensionValue
- the dimension value with which to compare the element. The
order of dimension values from least to greatest is
{DONTCARE, TRUE, FALSE, 0, 1, 2}
.public void setAtLeastIfValid(int row, int column, int minimumDimensionValue)
minimumDimensionValue
if the element is less. Does nothing
if row <0 or column < 0.
row
- the row of this IntersectionMatrix
, indicating
the interior, boundary or exterior of the first
Geometry
column
- the column of this IntersectionMatrix
,
indicating the interior, boundary or exterior of the second
Geometry
minimumDimensionValue
- the dimension value with which to compare the element. The
order of dimension values from least to greatest is
{DONTCARE, TRUE, FALSE, 0, 1, 2}
.public void setAtLeast(java.lang.String minimumDimensionSymbols)
IntersectionMatrix
, changes the
element to the corresponding minimum dimension symbol if the element is
less.
minimumDimensionSymbols
- nine dimension symbols with which to compare the elements of
this IntersectionMatrix
. The order of
dimension values from least to greatest is
{DONTCARE, TRUE, FALSE, 0, 1, 2}
.public void setAll(int dimensionValue)
IntersectionMatrix
to
dimensionValue
.
dimensionValue
- the dimension value to which to set this
IntersectionMatrix
s elements. Possible values
{TRUE, FALSE, DONTCARE, 0, 1, 2}
.public int get(int row, int column)
IntersectionMatrix
s
elements.
row
- the row of this IntersectionMatrix
, indicating
the interior, boundary or exterior of the first
Geometry
column
- the column of this IntersectionMatrix
,
indicating the interior, boundary or exterior of the second
Geometry
public boolean matches(java.lang.String requiredDimensionSymbols)
IntersectionMatrix
satisfies the required dimension symbols.
requiredDimensionSymbols
- nine dimension symbols with which to compare the elements of
this IntersectionMatrix
. Possible values are
{T, F, * , 0, 1, 2}
.
true
if this IntersectionMatrix
matches the required dimension symbolspublic IntersectionMatrix transpose()
IntersectionMatrix
as a conveniencepublic java.lang.String toString()
String
representation of this
IntersectionMatrix
.
toString
in class java.lang.Object
IntersectionMatrix
in row-major order.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |