Class Percentage

All Implemented Interfaces:
IConvertable, IPrimitiveValue, ISingleValue, IValue, Serializable, Comparable<Object>
Direct Known Subclasses:
AttributePercentage

public class Percentage extends NumberValue
This class holds a single percentage value.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Field Details

    • UNKNOWN

      public static final Percentage UNKNOWN
      This member defines the UNKNOWN value for the percentage type.
  • Constructor Details

    • Percentage

      protected Percentage()
    • Percentage

      public Percentage(Percentage other)
      Copy constructor.
      Parameters:
      other - value to copy.
    • Percentage

      public Percentage(double doubleValue)
    • Percentage

      public Percentage(IMultilingualText displayValue, double doubleValue)
      Constructs the Percentage with a display text.
      Parameters:
      displayValue - Text object containing the display value that should be used.
      doubleValue - a double containing the actual value.
    • Percentage

      public Percentage(String typeName, IMultilingualText displayValue, double doubleValue)
      Constructs the Percentage as a domain value.
      Parameters:
      typeName - The name of the domain the value belongs to.
      displayValue - Text object containing the display value that should be used.
      doubleValue - a double containing the actual value.
  • Method Details

    • valueOf

      public static NumberValue valueOf(Object obj)
    • parsePercentage

      public static double parsePercentage(Object obj)
    • forType

      public IPrimitiveValue forType(String typeName, IMultilingualText displayValue)
      Description copied from interface: IPrimitiveValue
      This method adds the type and display information to the value, and returns the value with this added information. The method will not change the state of the value the method is invoked on, but it will return a copy of the current value with the added information.
      Specified by:
      forType in interface IPrimitiveValue
      Overrides:
      forType in class NumberValue
      Parameters:
      typeName - The type of the value.
      displayValue - Multilingual text containing display values.
      Returns:
      The value with the added information.
    • getDataType

      public DataType getDataType()
      Description copied from interface: IValue
      This method returns the data type of the value.
      Specified by:
      getDataType in interface IValue
      Overrides:
      getDataType in class NumberValue
      Returns:
      The data type of the value.
    • toString

      public String toString()
      Overrides:
      toString in class NumberValue