com.softwareag.mdm.base.text
Class Nomenclature

java.lang.Object
  extended bycom.softwareag.mdm.base.text.Nomenclature

public class Nomenclature
extends Object

A Nomenclature is an ordered collection of NomenclatureItem instances.

See Also:
NomenclatureItem

Field Summary
static Step _items
           
static Comparator ComparatorByLabel
           
static Nomenclature EMPTY
           
 
Constructor Summary
Nomenclature()
          Creates Nomenclature with labels size equal to 1.
Nomenclature(int numberOfLabels)
          Creates Nomenclature with specified labels size.
 
Method Summary
 Nomenclature addItem(NomenclatureItem anItem)
          Adds a NomenclatureItem to this instance.
 Nomenclature addItemSeparator(Object aValue, String aLabel)
          Adds a NomenclatureItemSeparator with the content specified to this instance.
 Nomenclature addItemSeparator(Object aValue, String[] aLabels)
          Adds a NomenclatureItemSeparator with the content specified to this instance.
 Nomenclature addItemTitle(Object aValue, String aTitle)
          Adds a NomenclatureItemTitle with the content specified to this instance.
 Nomenclature addItemTitle(Object aValue, String[] aTitles)
          Adds a NomenclatureItemTitle with the content specified to this instance.
 Nomenclature addItemTitle(Object aValue, String[] aTitles, int level)
          Adds a NomenclatureItemTitle with the content specified to this instance.
 Nomenclature addItemTitle(Object aValue, String aTitle, int level)
          Adds a NomenclatureItemTitle with the content specified to this instance.
 Nomenclature addItemValue(Object aValue, String aLabel)
          Adds a NomenclatureItemValue with the content specified to this instance.
 Nomenclature addItemValue(Object aValue, String[] aLabels)
          Adds a NomenclatureItemValue with the content specified to this instance.
 Nomenclature addNomenclature(Nomenclature anotherNomenclature)
          Adds all the item of the specified Nomenclature to this instance.
 boolean equals(Object x)
           
 NomenclatureItem findNomenclatureItemWithValue(Object aSearchedValue)
          Returns first occurrence of NomenclatureItem whose value is equal to the argument.
 List getAllValues()
          Returns all the item's values.
 List getItems()
          Returns all items (internal, used for debug tag)
 NomenclatureItem getItems(int index)
          Returns the item at the specified position in this nomenclature.
 Iterator getItemsIterator()
          Returns an iterator over all the items of this nomenclature.
 int getLabelsSize()
          Returns the number of labels that each item of this nomenclature must have.
 int getSize()
          Returns the number of items in this nomenclature.
 void setItems(List aList)
          Deprecated.  
 void setLastItemAsDefault(boolean isDefault)
          Set last added item as default.
 void sortByLabel()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final Nomenclature EMPTY

_items

public static final Step _items

ComparatorByLabel

public static final Comparator ComparatorByLabel
Constructor Detail

Nomenclature

public Nomenclature()
Creates Nomenclature with labels size equal to 1.


Nomenclature

public Nomenclature(int numberOfLabels)
Creates Nomenclature with specified labels size.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem), getLabelsSize()
Method Detail

addItem

public Nomenclature addItem(NomenclatureItem anItem)
                     throws IllegalArgumentException
Adds a NomenclatureItem to this instance. Item is added at the end of the ordered list of items.

Returns:
this instance
Throws:
IllegalArgumentException - If the item to be added has not the same number of labels as the number specified in this constructor
See Also:
Nomenclature(int), addNomenclature(com.softwareag.mdm.base.text.Nomenclature)

addItemSeparator

public Nomenclature addItemSeparator(Object aValue,
                                     String[] aLabels)
Adds a NomenclatureItemSeparator with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemSeparator

public Nomenclature addItemSeparator(Object aValue,
                                     String aLabel)
Adds a NomenclatureItemSeparator with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemTitle

public Nomenclature addItemTitle(Object aValue,
                                 String[] aTitles)
Adds a NomenclatureItemTitle with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemTitle

public Nomenclature addItemTitle(Object aValue,
                                 String[] aTitles,
                                 int level)
Adds a NomenclatureItemTitle with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemTitle

public Nomenclature addItemTitle(Object aValue,
                                 String aTitle)
Adds a NomenclatureItemTitle with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemTitle

public Nomenclature addItemTitle(Object aValue,
                                 String aTitle,
                                 int level)
Adds a NomenclatureItemTitle with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemValue

public Nomenclature addItemValue(Object aValue,
                                 String[] aLabels)
Adds a NomenclatureItemValue with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addItemValue

public Nomenclature addItemValue(Object aValue,
                                 String aLabel)
Adds a NomenclatureItemValue with the content specified to this instance.

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

addNomenclature

public Nomenclature addNomenclature(Nomenclature anotherNomenclature)
                             throws com.softwareag.mdm.base.misc.PreconditionFailure
Adds all the item of the specified Nomenclature to this instance. Items are added in the same order at the end of the list of items.

Returns:
this instance
Throws:
com.softwareag.mdm.base.misc.PreconditionFailure - If the nomenclature to be added has not the same number of labels as the number specified in this instance.
See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem)

equals

public boolean equals(Object x)

findNomenclatureItemWithValue

public NomenclatureItem findNomenclatureItemWithValue(Object aSearchedValue)
Returns first occurrence of NomenclatureItem whose value is equal to the argument. Returns null if no item is found.


getAllValues

public List getAllValues()
Returns all the item's values. Only items which returns true to method isValueItem() are included in the list returned.

See Also:
NomenclatureItem.isValueItem()

getItems

public List getItems()
Returns all items (internal, used for debug tag)


getItems

public NomenclatureItem getItems(int index)
Returns the item at the specified position in this nomenclature.


getItemsIterator

public Iterator getItemsIterator()
Returns an iterator over all the items of this nomenclature.


getLabelsSize

public int getLabelsSize()
Returns the number of labels that each item of this nomenclature must have.

See Also:
Nomenclature(int)

getSize

public int getSize()
Returns the number of items in this nomenclature.


setItems

public void setItems(List aList)
Deprecated.  

This method is replaced by addItem() or addNomenclature()

See Also:
addItem(com.softwareag.mdm.base.text.NomenclatureItem), addNomenclature(com.softwareag.mdm.base.text.Nomenclature)

setLastItemAsDefault

public void setLastItemAsDefault(boolean isDefault)
                          throws IllegalStateException
Set last added item as default.

Throws:
IllegalStateException - If this nomenclature has no item
See Also:
NomenclatureItem.setDefaultItem(boolean)

sortByLabel

public void sortByLabel()

toString

public String toString()


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.