public class ReferenceList extends ArrayList<ReferenceItem>
Constructor and Description |
---|
ReferenceList()
Default constructor.
|
ReferenceList(int nInitialCapacity)
Creates a new reference list with a specified initial capacity.
|
Modifier and Type | Method and Description |
---|---|
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
|
void |
addItem(String strCode,
String strName)
This method adds a new element (code, name) to the list
|
void |
checkItems(String[] valuesToCheck)
CheckItems when are selected
|
static ReferenceList |
convert(Collection collection,
String strCodeAttribute,
String strNameAttribute,
boolean bNumericCode)
Converts a collection to a ReferenceList
|
static ReferenceList |
convert(Map<String,String> map)
Convert a Map<String, String> into a ReferenceList
|
Map<String,String> |
toMap()
Convert the ReferenceList into a map
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
containsAll, equals, hashCode
parallelStream, stream
public ReferenceList()
public ReferenceList(int nInitialCapacity)
nInitialCapacity
- The initial capacity of the collectionpublic void addItem(String strCode, String strName)
strCode
- The code as a StringstrName
- The name corresponding to the code as a Stringpublic void addItem(int nCode, String strName)
nCode
- The code to convert an addstrName
- The name corresponding to the code as a Stringpublic static ReferenceList convert(Collection collection, String strCodeAttribute, String strNameAttribute, boolean bNumericCode)
collection
- The collection to convertstrCodeAttribute
- 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 otherwisepublic static ReferenceList convert(Map<String,String> map)
map
- the map to convertpublic Map<String,String> toMap()
public void checkItems(String[] valuesToCheck)
valuesToCheck
- The list of stringCopyright © 2020 City of Paris. All rights reserved.