All Implemented Interfaces:
IConvertable, IListValue, IValue, IDomain, Serializable

public class Domain extends ListValue implements IDomain
The domain class is used to hold all the values that are valid for an attribute. The values in the domain may not be (re)ordered, as they need to be in the same order as specified by the data-source.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • Domain

      public Domain(IDomainDefinition definition)
      Constructs the domain from the domain definition, using all the values from the defined domain.
      Parameters:
      definition - The definition that should be used to construct the domain.
    • Domain

      public Domain(IDomainDefinition definition, IPrimitiveValue[] values)
      Constructs the domain from the definition and an array of values that are currently valid.
      Parameters:
      definition - The domain definition of the domain.
      values - Array of values that are currently valid in the domain.
  • Method Details

    • getDefinition

      public IDomainDefinition getDefinition()
      Description copied from interface: IDomain
      This method returns the definition of this domain. The domain definition contains additional information like the name and the complete set of values that may be valid.
      Specified by:
      getDefinition in interface IDomain
      Returns:
      The definition of this domain.
    • contains

      public boolean contains(Object obj)
      Description copied from interface: IValue
      This method returns a boolean indicating if the object passed to this method is entirely part of this value. This method will thus also return true when the object passed is equal to this value, but the method will return false when only part (or none) of the object is represented by this value. Note that for value types that are singular in nature (for instance, implementations of ISingleValue) the operation of this method is limited to an equality check.
      Specified by:
      contains in interface IValue
      Overrides:
      contains in class ListValue
      Parameters:
      obj - Object for which should be checked if it is entirely part of this value.
      Returns:
      boolean indicating if the object passed is entirely part of this value.
    • getValue

      public IPrimitiveValue getValue(Object objValue)
      Description copied from interface: IDomain
      This method returns the internal domain value identified by the given object value. The value passed to this method may be a string containing the short value of the requested domain value, or a IPrimitiveValue containing the short value.
      Specified by:
      getValue in interface IDomain
      Parameters:
      objValue - The value for which the domain value is requested.
      Returns:
      The domain value for the specified value.