Class ReferenceList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<ReferenceItem>, Collection<ReferenceItem>, List<ReferenceItem>, RandomAccess

public class ReferenceList extends ArrayList<ReferenceItem>
This class provides the structure for a list of references values Each element includes a code and a name
See Also:
  • Constructor Details

    • ReferenceList

      public ReferenceList()
      Default constructor.
    • ReferenceList

      public ReferenceList(int nInitialCapacity)
      Creates a new reference list with a specified initial capacity.
      Parameters:
      nInitialCapacity - The initial capacity of the collection
  • Method Details

    • addItem

      public void addItem(String strCode, String strName)
      This method adds a new element (code, name) to the list
      Parameters:
      strCode - The code as a String
      strName - The name corresponding to the code as a String
    • addItem

      public void addItem(int nCode, String strName)
      This method converts the int code specified in parameter as a String and adds a new element (code, name) to the list
      Parameters:
      nCode - The code to convert an add
      strName - The name corresponding to the code as a String
    • convert

      public static ReferenceList convert(Collection collection, String strCodeAttribute, String strNameAttribute, boolean bNumericCode)
      Converts a collection to a ReferenceList
      Parameters:
      collection - The collection to convert
      strCodeAttribute - The name of the code attribute. Ex : "id" to call getId()
      strNameAttribute - The name of the code attribute. Ex : "name" to call getName()
      bNumericCode - true if the code getter returns an Integer, false otherwise
      Returns:
      The ReferenceList filled
      Since:
      v1.1
    • convert

      public static ReferenceList convert(Map<String,String> map)
      Convert a Map<String, String> into a ReferenceList
      Parameters:
      map - the map to convert
      Returns:
      the converted ReferenceList
    • toMap

      public Map<String,String> toMap()
      Convert the ReferenceList into a map
      Returns:
      the converted map
    • checkItems

      public void checkItems(String[] valuesToCheck)
      CheckItems when are selected
      Parameters:
      valuesToCheck - The list of string