Package com.onwbp.base.text

# Class NomenclatureItemValue<T>

java.lang.Object
com.onwbp.base.text.NomenclatureItem<T>
com.onwbp.base.text.NomenclatureItemValue<T>

public class NomenclatureItemValue<T> extends NomenclatureItem<T>
A `NomenclatureItemValue` is a label value in a containing `Nomenclature`. The value should correspond to the associated type.

The code that implements the layout must decide how to display an instance of this class.

See Also:
  - `Nomenclature`

- ## Field Summary

  ### Fields inherited from class com.onwbp.base.text.NomenclatureItem

  `_defaultLabel, _value`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NomenclatureItemValue()`
  `NomenclatureItemValue(T newValue, String newLabel)`
  `NomenclatureItemValue(T newValue, String[] newLabels)`
  `NomenclatureItemValue(T newValue, String[] newLabels, Locale[] locales)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object x)`
  `String`
  `getDefaultLabel()`
  Returns first label.
  `String`
  `getLabel(int index)`
  Returns the label at the specified position (from 0 to the number of labels - 1).
  `String`
  `getLabel(Locale aLocale)`
  Returns the label defined for the specified locale.
  `int`
  `hashCode()`
  `boolean`
  `isLocalized()`
  `void`
  `setDefaultLabel(String aString)`
  Sets first label.
  `void`
  `setLabel(int index, String aString)`
  Replaces the label at the specified position in all labels with the specified string.

  ### Methods inherited from class com.onwbp.base.text.NomenclatureItem

  `getValue, isDefaultItem, isValueItem, setDefaultItem, setValue, toString`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### NomenclatureItemValue

    public NomenclatureItemValue()

  - ### NomenclatureItemValue

    public NomenclatureItemValue(T newValue, String[] newLabels)

  - ### NomenclatureItemValue

    public NomenclatureItemValue(T newValue, String[] newLabels, Locale[] locales)

  - ### NomenclatureItemValue

    public NomenclatureItemValue(T newValue, String newLabel)

- ## Method Details

  - ### equals

    public boolean equals(Object x)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### isLocalized

    public boolean isLocalized()
    Specified by:
      `isLocalized` in class `NomenclatureItem<T>`

  - ### getLabel

    public String getLabel(Locale aLocale)
    Returns the label defined for the specified locale.
    Specified by:
      `getLabel` in class `NomenclatureItem<T>`
    Parameters:
      `aLocale` - the locale to search for. Can be `null`.
    Returns:
      `null` if specified locale does not exist or a `null` label is defined for the locale.

  - ### setLabel

    public void setLabel(int index, String aString)
    Replaces the label at the specified position in all labels with the specified string.
    Specified by:
      `setLabel` in class `NomenclatureItem<T>`

  - ### getDefaultLabel

    public String getDefaultLabel()
    Returns first label.
    Specified by:
      `getDefaultLabel` in class `NomenclatureItem<T>`

  - ### getLabel

    public String getLabel(int index)
    Returns the label at the specified position (from 0 to the number of labels - 1).
    Specified by:
      `getLabel` in class `NomenclatureItem<T>`

  - ### setDefaultLabel

    public void setDefaultLabel(String aString)
    Sets first label.
    Specified by:
      `setDefaultLabel` in class `NomenclatureItem<T>`