Package yearreview.app.util.value
Class Value
java.lang.Object
yearreview.app.util.value.Value
- All Implemented Interfaces:
Comparable<Value>
- Direct Known Subclasses:
DistanceValue
,DurationValue
A Value represents one of the types specified in the
ValueTypes
-enum.- Author:
- ColdStone37
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ValueType
getType()
Gets the Type of the Value.protected abstract Object
getValue()
Gets the internal representation of the Value.abstract Value
Gets the sum of this Value and another Valueabstract String
toString()
Formats the stored Value to a String.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
Value
public Value()
-
-
Method Details
-
getType
Gets the Type of the Value.- Returns:
- type
-
toString
Formats the stored Value to a String. -
plus
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
Gets the internal representation of the Value.- Returns:
- internal representation
-