Class ExtendedDocumentArray
java.lang.Object
com.inductiveautomation.ignition.common.document.DocumentElement
com.inductiveautomation.ignition.common.document.DocumentArray
com.inductiveautomation.ignition.common.document.ExtendedDocumentArray
- All Implemented Interfaces:
- com.inductiveautomation.ignition.common.document.DiffTree.Producer<DocumentElement>,- Serializable,- Iterable<DocumentElement>
Allows cloning a 
It's extremely important that the delegate DocumentArray is never modified. In cases where the delegate DocumentArray might change,
DocumentArray without having to create a deep copy of all it's elements. This is managed by
 tracking all modifications to a delegate DocumentArray instead of applying those modifications directly to the
 DocumentArray. If extend(com.inductiveautomation.ignition.common.document.DocumentArray) is called on an ExtendedDocumentArray the delegate
 DocumentArray is reused and modifications are copied to the new ExtendedDocumentArray.
 It's extremely important that the delegate DocumentArray is never modified. In cases where the delegate DocumentArray might change,
DocumentArray.deepCopy() should be used instead.- See Also:
- 
Field SummaryFields inherited from class com.inductiveautomation.ignition.common.document.DocumentArrayelements
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(DocumentElement element) Adds the specified element to self.voidaddAll(DocumentArray array) Adds all the elements of the specified array to self.booleancontains(DocumentElement element) Returns true if this array contains the specified element.deepCopy()Creates a deep copy of this element and all its childrenstatic DocumentArrayextend(DocumentArray array) get(int i) Returns the ith element of the array.iterator()Provides a safe iterator that extends elements before publishing through iterator, preventing mutation of backing array elements.remove(int index) Removes the element at the specified position in this array.booleanremove(DocumentElement element) Removes the first occurrence of the specified element from this array, if it is present.set(int index, DocumentElement element) Replaces the element at the specified position in this array with the specified element.intsize()Returns the number of elements in the array.protected Iterator<DocumentElement>Provides iterator that publishes objects from backing array.Methods inherited from class com.inductiveautomation.ignition.common.document.DocumentArrayadd, add, add, add, equals, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsCharacter, getAsDouble, getAsFloat, getAsInt, getAsLong, getAsNumber, getAsShort, getAsString, hashCode, toJsonElementMethods inherited from class com.inductiveautomation.ignition.common.document.DocumentElementfromJson, getAsDocument, getAsDocumentArray, getAsDocumentNull, getAsDocumentPrimitive, isDocument, isDocumentArray, isDocumentNull, isDocumentPrimitive, toString, toStringNoIndentMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
extend
- 
deepCopyDescription copied from class:DocumentArrayCreates a deep copy of this element and all its children- Overrides:
- deepCopyin class- DocumentArray
 
- 
addDescription copied from class:DocumentArrayAdds the specified element to self.- Overrides:
- addin class- DocumentArray
- Parameters:
- element- the element that needs to be added to the array.
 
- 
addAllDescription copied from class:DocumentArrayAdds all the elements of the specified array to self.- Overrides:
- addAllin class- DocumentArray
- Parameters:
- array- the array whose elements need to be added to the array.
 
- 
setDescription copied from class:DocumentArrayReplaces the element at the specified position in this array with the specified element. Element can be null.- Overrides:
- setin class- DocumentArray
- Parameters:
- index- index of the element to replace
- element- element to be stored at the specified position
- Returns:
- the element previously at the specified position
 
- 
removeDescription copied from class:DocumentArrayRemoves the first occurrence of the specified element from this array, if it is present. If the array does not contain the element, it is unchanged.- Overrides:
- removein class- DocumentArray
- Parameters:
- element- element to be removed from this array, if present
- Returns:
- true if this array contained the specified element, false otherwise
 
- 
removeDescription copied from class:DocumentArrayRemoves the element at the specified position in this array. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the array.- Overrides:
- removein class- DocumentArray
- Parameters:
- index- index the index of the element to be removed
- Returns:
- the element previously at the specified position
 
- 
containsDescription copied from class:DocumentArrayReturns true if this array contains the specified element.- Overrides:
- containsin class- DocumentArray
- Parameters:
- element- whose presence in this array is to be tested
- Returns:
- true if this array contains the specified element.
 
- 
sizepublic int size()Description copied from class:DocumentArrayReturns the number of elements in the array.- Specified by:
- sizein interface- com.inductiveautomation.ignition.common.document.DiffTree.Producer<DocumentElement>
- Overrides:
- sizein class- DocumentArray
- Returns:
- the number of elements in the array.
 
- 
iteratorProvides a safe iterator that extends elements before publishing through iterator, preventing mutation of backing array elements.- Specified by:
- iteratorin interface- Iterable<DocumentElement>
- Overrides:
- iteratorin class- DocumentArray
- Returns:
- an iterator to navigate the elements of the array.
 
- 
unsafeIteratorProvides iterator that publishes objects from backing array. Used internally for more efficient access to elements that we know won't be modified (equals, hashCode, etc).- Overrides:
- unsafeIteratorin class- DocumentArray
 
- 
getDescription copied from class:DocumentArrayReturns the ith element of the array.- Specified by:
- getin interface- com.inductiveautomation.ignition.common.document.DiffTree.Producer<DocumentElement>
- Overrides:
- getin class- DocumentArray
- Parameters:
- i- the index of the element that is being sought.
- Returns:
- the element present at the ith index.
 
 
-