Package ru.ewc.decita
Class Coordinate
java.lang.Object
ru.ewc.decita.Coordinate
- All Implemented Interfaces:
Comparable<Coordinate>
I am a simple data structure describing the position of the required value. My responsibility is
to provide everything that is needed to retrieve that value. The position of every value is
described by the
Locator
's ID and the String
value's ID, so it looks like a
2D-coordinate.- Since:
- 0.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A regular expression for a number.static final Coordinate
A constant valueCoordinate
that points to the "true" value. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Coordinate other) boolean
Tests ifCoordinate
is already computed, i.e.locateIn
(ComputationContext context) Locates the required value in the providedComputationContext
.
-
Field Details
-
TRUE
A constant valueCoordinate
that points to the "true" value. -
NUMBER_REGEXP
A regular expression for a number.- See Also:
-
-
Constructor Details
-
Coordinate
Ctor.- Parameters:
locator
- TheLocator
identifier.fragment
- The value's identifier.
-
-
Method Details
-
locateIn
Locates the required value in the providedComputationContext
. Always return the same object with updated fields (not a new instance) because there could be many references to this instance, i.e. the sameCoordinate
could be used in manyCondition
s.- Parameters:
context
- ProvidedComputationContext
.- Returns:
- A constant value
Coordinate
. - Throws:
DecitaException
- If the specifiedLocator
is missing.
-
isComputed
public boolean isComputed()Tests ifCoordinate
is already computed, i.e. its value is constant.- Returns:
- True, if
Coordinate
points to a constant value.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Coordinate>
-