com.ibm.commons.iloader.node.lookups.api
Class StringLookup

java.lang.Object
  extended by com.ibm.commons.iloader.node.lookups.api.AbstractLookup
      extended by com.ibm.commons.iloader.node.lookups.api.StringLookup
All Implemented Interfaces:
ILookup

public class StringLookup
extends com.ibm.commons.iloader.node.lookups.api.AbstractLookup

A String based lookup. All of the values and labels are strings.


Constructor Summary
StringLookup(java.lang.String[] codes)
          Create a StringLookup with identical codes and labels.
StringLookup(java.lang.String[] codes, java.lang.String[] labels)
          Create the StringLookup with the given codes (model values) and associated labels (by shared index).
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the object being compared to is a StringLookup and its contents are identical to the contents of the current StringLookup.
 java.lang.String getCode(int index)
          Return the code or model value for this index.
 java.lang.String getLabel(int index)
          Return the label displayed to the user for this index.
 int size()
          Return the number of items in this lookup.
 
Methods inherited from class com.ibm.commons.iloader.node.lookups.api.AbstractLookup
addLookupListener, addNotify, getImage, getLabelFromCode, getLabelFromCodeIgnoreCase, notifyLookupChanged, removeLookupListener, removeNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringLookup

public StringLookup(java.lang.String[] codes)
Create a StringLookup with identical codes and labels.


StringLookup

public StringLookup(java.lang.String[] codes,
                    java.lang.String[] labels)
Create the StringLookup with the given codes (model values) and associated labels (by shared index). Please note that the size of both arrays should be identical.

Method Detail

size

public int size()
Description copied from interface: ILookup
Return the number of items in this lookup.


getCode

public java.lang.String getCode(int index)
Description copied from interface: ILookup
Return the code or model value for this index.


getLabel

public java.lang.String getLabel(int index)
Description copied from interface: ILookup
Return the label displayed to the user for this index.


equals

public boolean equals(java.lang.Object obj)
Returns true if the object being compared to is a StringLookup and its contents are identical to the contents of the current StringLookup.

Overrides:
equals in class java.lang.Object
Parameters:
obj - A StringLookup object