Package repast.simphony.ui.probe
Class QuantityConverter
java.lang.Object
repast.simphony.ui.probe.QuantityConverter
- All Implemented Interfaces:
StringConverter<javax.measure.Quantity<?>>
Converts an Amount to and from a String representation.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.measure.Quantity<?>
fromString
(String strRep) Creates an Object from a String representation.toString
(javax.measure.Quantity<?> quantity) Converts the specified object to a String representation and returns that representation.
-
Constructor Details
-
QuantityConverter
public QuantityConverter()
-
-
Method Details
-
toString
Converts the specified object to a String representation and returns that representation. The represenation should be such thatfromString
can recreate the Object.- Specified by:
toString
in interfaceStringConverter<javax.measure.Quantity<?>>
- Parameters:
obj
- the Object to convert.- Returns:
- a String representation of the Object.
-
fromString
Creates an Object from a String representation.- Specified by:
fromString
in interfaceStringConverter<javax.measure.Quantity<?>>
- Parameters:
strRep
- the string representation- Returns:
- the created Object.
-