Class Value

java.lang.Object
yearreview.app.util.value.Value
All Implemented Interfaces:
Comparable<Value>
Direct Known Subclasses:
DistanceValue, DurationValue

public abstract class Value extends Object implements Comparable<Value>
A Value represents one of the types specified in the ValueTypes-enum.
Author:
ColdStone37
  • Constructor Details

    • Value

      public Value()
  • Method Details

    • getType

      public abstract ValueType getType()
      Gets the Type of the Value.
      Returns:
      type
    • toString

      public abstract String toString()
      Formats the stored Value to a String.
      Overrides:
      toString in class Object
      Returns:
      formatted value
    • plus

      public abstract Value plus(Value other)
      Gets the sum of this Value and another Value
      Parameters:
      other - Value to add
      Returns:
      summed Value or null if the Values weren't of the same ValueType
    • getValue

      protected abstract Object getValue()
      Gets the internal representation of the Value.
      Returns:
      internal representation