Class CharacteristicPoint<A extends javax.measure.Quantity<A>,O extends javax.measure.Quantity<O>>
java.lang.Object
edu.ie3.datamodel.models.input.system.characteristic.CharacteristicPoint<A,O>
- All Implemented Interfaces:
Serializable
,Comparable<CharacteristicPoint<A,
O>>
public class CharacteristicPoint<A extends javax.measure.Quantity<A>,O extends javax.measure.Quantity<O>>
extends Object
implements Comparable<CharacteristicPoint<A,O>>, Serializable
Class to describe one point of a given
CharacteristicInput
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCharacteristicPoint
(String input, javax.measure.Unit<A> abscissaUnit, javax.measure.Unit<O> ordinateUnit) Builds a point from a given input string.CharacteristicPoint
(tech.units.indriya.ComparableQuantity<A> x, tech.units.indriya.ComparableQuantity<O> y) Build a new point -
Method Summary
-
Field Details
-
REQUIRED_FORMAT
- See Also:
-
-
Constructor Details
-
CharacteristicPoint
public CharacteristicPoint(tech.units.indriya.ComparableQuantity<A> x, tech.units.indriya.ComparableQuantity<O> y) Build a new point- Parameters:
x
- Value on the abscissay
- Value on the ordinate
-
CharacteristicPoint
public CharacteristicPoint(String input, javax.measure.Unit<A> abscissaUnit, javax.measure.Unit<O> ordinateUnit) throws ParsingException Builds a point from a given input string. The string has to be of format '(%d,%d)'. Spaces are tolerated- Parameters:
input
- Input string to parseabscissaUnit
- Unit to use on the abscissaordinateUnit
- Unit to use on the ordinate- Throws:
ParsingException
- If the input is malformed
-
-
Method Details
-
getX
- Returns:
- the position on the abscissa
-
getY
- Returns:
- the position on the ordinate
-
serialize
Serializes the given point to a string- Returns:
- The serialized point
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
Compares this instance against another point. They are compared on the abscissa first. If they are on the same location there, the ordinate is taken into account.- Specified by:
compareTo
in interfaceComparable<A extends javax.measure.Quantity<A>>
- Parameters:
b
- The other point- Returns:
- The comparision result
-