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 Details

  • 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 abscissa
      y - 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 parse
      abscissaUnit - Unit to use on the abscissa
      ordinateUnit - Unit to use on the ordinate
      Throws:
      ParsingException - If the input is malformed
  • Method Details

    • getX

      public tech.units.indriya.ComparableQuantity<A> getX()
      Returns:
      the position on the abscissa
    • getY

      public tech.units.indriya.ComparableQuantity<O> getY()
      Returns:
      the position on the ordinate
    • serialize

      public String serialize()
      Serializes the given point to a string
      Returns:
      The serialized point
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(CharacteristicPoint<A,O> b)
      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 interface Comparable<A extends javax.measure.Quantity<A>>
      Parameters:
      b - The other point
      Returns:
      The comparision result