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
FieldsModifier and TypeFieldDescriptionstatic final StringA regular expression for a number.static final CoordinateA constant valueCoordinatethat points to the "true" value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(Coordinate other) booleanTests ifCoordinateis already computed, i.e.locateIn(ComputationContext context) Locates the required value in the providedComputationContext.
-
Field Details
-
TRUE
A constant valueCoordinatethat points to the "true" value. -
NUMBER_REGEXP
A regular expression for a number.- See Also:
-
-
Constructor Details
-
Coordinate
Ctor.- Parameters:
locator- TheLocatoridentifier.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 sameCoordinatecould be used in manyConditions.- Parameters:
context- ProvidedComputationContext.- Returns:
- A constant value
Coordinate. - Throws:
DecitaException- If the specifiedLocatoris missing.
-
isComputed
public boolean isComputed()Tests ifCoordinateis already computed, i.e. its value is constant.- Returns:
- True, if
Coordinatepoints to a constant value.
-
compareTo
- Specified by:
compareToin interfaceComparable<Coordinate>
-