Package repast.simphony.ui.probe
Class QuantityConverter
- java.lang.Object
-
- repast.simphony.ui.probe.QuantityConverter
-
- All Implemented Interfaces:
StringConverter<javax.measure.Quantity<?>>
public class QuantityConverter extends Object implements StringConverter<javax.measure.Quantity<?>>
Converts an Amount to and from a String representation.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description QuantityConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.measure.Quantity<?>
fromString(String strRep)
Creates an Object from a String representation.String
toString(javax.measure.Quantity<?> quantity)
Converts the specified object to a String representation and returns that representation.
-
-
-
Method Detail
-
toString
public String toString(javax.measure.Quantity<?> quantity)
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
public javax.measure.Quantity<?> fromString(String strRep)
Creates an Object from a String representation.- Specified by:
fromString
in interfaceStringConverter<javax.measure.Quantity<?>>
- Parameters:
strRep
- the string representation- Returns:
- the created Object.
-
-