USADriveIdJurisdSubfile
USADriveIdJurisdSubfile class
Class for Jurisdiction specific fields for USA DL
new USADriveIdJurisdSubfile()
Methods
| Name | Description |
|---|---|
| addOrReplace(id, value) | Adds a new DataElement with the specified identifier and value, or replaces the existing element if an entry with the sa |
| addOrReplaceNode(node) | Adds new DataElement or replaces it if ElementID already exists. |
| clear() | Clears all data elements |
| findDataElement(id, isOpenOrCreate) | Searches for data element by 3-letter id |
| get(indexOrId) | Gets a data element by its index or 3-letter ID. |
| insert(index, node) | Inserts the specified DataElement at the given index. If a DataElement with the same ElementID already exists, it will b |
| remove(indexOrId) | Tries to remove an element by its index or 3-letter ID. |
| set(indexOrId, value) | Sets a data element by its index or 3-letter ID. |
| size() | Returns number of data elements |
addOrReplace(id, 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.
| Parameter | Description |
|---|---|
| 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.
addOrReplaceNode(node)
Adds new DataElement or replaces it if ElementID already exists.
| Parameter | Description |
|---|---|
| node | DataElement to add |
Returns: Added/replaced data element
clear()
Clears all data elements
findDataElement(id, isOpenOrCreate)
Searches for data element by 3-letter id
| Parameter | Description |
|---|---|
| id | 3-letter id |
| isOpenOrCreate | If true, it will be created if not found |
Returns: Found data element
get(indexOrId)
Gets a data element by its index or 3-letter ID.
| Parameter | Type | Description |
|---|---|---|
| indexOrId | number|string | Integer index or 3-letter element ID. |
Returns: DataElement — Corresponding data element.
insert(index, node)
Inserts the specified DataElement at the given index. If a DataElement with the same ElementID already exists, it will be replaced.
| Parameter | Description |
|---|---|
| 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.
remove(indexOrId)
Tries to remove an element by its index or 3-letter ID.
| Parameter | Type | Description |
|---|---|---|
| indexOrId | number|string | Integer index or 3-letter element ID. |
Returns: boolean — true if the element was removed; otherwise, false.
set(indexOrId, value)
Sets a data element by its index or 3-letter ID.
| Parameter | Type | Description |
|---|---|---|
| indexOrId | number|string | Integer index or 3-letter element ID. |
| value | DataElement | Data element to set. |
size()
Returns number of data elements