Class USADriveIdJurisdSubfile
Class for Jurisdiction specific fields for USA DL
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a jurisdiction-specific data field used in documents, for example ElementID = "ZVA" with Value = "01". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds new DataElement or replaces it if ElementID already exists.addOrReplace(String id, String value) Adds a new DataElement with the specified identifier and value, or replaces the existing element if an entry with the same ElementID is already present.final voidclear()Clears all data elementsfindDataElement(String id, boolean isOpenOrCreate) Searches for data element by 3-letter idget(int index) Indexing by index numberIndexing by 3-letter element idinsert(int index, USADriveIdJurisdSubfile.DataElement node) Inserts the specified DataElement at the given index.final booleanremove(int index) Tries to remove element at indexfinal booleanTries to remove element with 3-letter idfinal voidset(int index, USADriveIdJurisdSubfile.DataElement value) Indexing by index numberfinal voidset(String id, USADriveIdJurisdSubfile.DataElement value) Indexing by 3-letter element idfinal intsize()Returns number of data elements
-
Constructor Details
-
USADriveIdJurisdSubfile
public USADriveIdJurisdSubfile()
-
-
Method Details
-
get
Indexing by 3-letter element id
- Parameters:
id- 3-letter element id- Returns:
- Corresponding DataElement
-
set
Indexing by 3-letter element id
- Parameters:
id- 3-letter element id
-
get
Indexing by index number
- Parameters:
index- Element index (int)- Returns:
- Corresponding DataElement
-
set
Indexing by index number
- Parameters:
index- Element index (int)
-
findDataElement
Searches for data element by 3-letter id
- Parameters:
id- 3-letter idisOpenOrCreate- If true, it will be created if not found- Returns:
- Found data element
-
size
public final int size()Returns number of data elements
-
clear
public final void clear()Clears all data elements
-
remove
public final boolean remove(int index) Tries to remove element at index
- Parameters:
index- index number- Returns:
- true if successful, false if out of range
-
remove
Tries to remove element with 3-letter id
- Parameters:
id- 3-letter id- Returns:
- true if successful, false if no such id
-
insert
public final USADriveIdJurisdSubfile.DataElement insert(int index, USADriveIdJurisdSubfile.DataElement node) Inserts the specified DataElement at the given index. If a DataElement with the same ElementID already exists, it will be replaced.
- Parameters:
index- The zero-based index at which the element should be inserted.node- The DataElement instance to insert or replace at the target position.- Returns:
- The DataElement that was inserted or used to replace an existing entry.
-
addOrReplace
public final USADriveIdJurisdSubfile.DataElement addOrReplace(USADriveIdJurisdSubfile.DataElement node) Adds new DataElement or replaces it if ElementID already exists.
- Parameters:
node- DataElement to add- Returns:
- Added/replaced data element
-
addOrReplace
Adds a new DataElement with the specified identifier and value, or replaces the existing element if an entry with the same ElementID is already present.
- Parameters:
id- A 3-letter identifier that uniquely specifies the jurisdiction-related data element.value- The text value assigned to the data element; this value will overwrite the existing one if the element already exists.- Returns:
- The DataElement instance that was added to the collection or updated in place.
-