Class Coordinate

java.lang.Object
com.motivewave.platform.sdk.common.Coordinate

public class Coordinate extends Object
Specifies a real point on a graph which includes time (in milliseconds since 1970) and a value (typically price).
  • Constructor Details

    • Coordinate

      public Coordinate(long time, double value)
      Creates a coordinate.
      Parameters:
      time - time value in milliseconds since 1970 (x value)
      value - real value of this coordinate (y value)
  • Method Details

    • fromJson

      public static Coordinate fromJson(String str)
    • getTime

      public long getTime()
      Gets the time (in milliseconds since 1970) for this coordinate.
      Returns:
      time in milliseconds since 1970
    • getValue

      public double getValue()
      Gets the value for this coordinate.
      Returns:
      value (y axis value)
    • equals

      public boolean equals(Object o)
      Compares this coordinate with the given object and returns true if they are equal.
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare to
      Returns:
      true if this object equals the given object
    • toString

      public String toString()
      Returns a printable string for this coordinate (time, value)
      Overrides:
      toString in class Object
      Returns:
      printable string representation of this coordinate
    • hashCode

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

      public String toJson()