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 Details

    • QuantityConverter

      public QuantityConverter()
  • Method Details

    • 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 that fromString can recreate the Object.
      Specified by:
      toString in interface StringConverter<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 interface StringConverter<javax.measure.Quantity<?>>
      Parameters:
      strRep - the string representation
      Returns:
      the created Object.