|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
S - type for all setter operationsR - type for all remove operationspublic interface IndexedFileModifier<S,R>
Interface which allows modifications on the underlying storage using a generic interface. You can manipulate storage contents using elements with the following mutable actions.
| Method Summary | |
|---|---|
void |
abortChanges()
Aborts any in-memory changes that currently exist. |
void |
add(long index,
S... elements)
Adds an array of list at the index location in the order they appear in the array. |
void |
add(S element)
Appends the content of the buffer to the end of the storage medium. |
void |
addAll(long index,
java.util.List<S> elements)
Add new content from supplied buffer at the index position. |
void |
remove(long index)
Removes an element at the index location. |
void |
removeAll()
All elements are removed. |
void |
removeAll(java.util.Collection<R> elements)
Bulk remove, that removes several elements from the collection. |
void |
removeAll(long index,
long count)
Removes a consecutive sequence of elements starting with the element at the index position. |
void |
removeAll(R... elements)
Bulk remove of all the elements found in the array. |
void |
replace(long index,
S element)
Replaces the index element with the new element specified. |
void |
retainAll(java.util.List<R> elements)
Bulk remove, that removes all records other then the ones found in the list. |
void |
retainAll(R... elements)
Bulk remove, that removes all records other then the ones found in the array. |
void |
set(long index,
S element)
Sets the element at index position to the specified element. |
void |
swap(R dst,
R src)
Swaps the two elements around, physically, within the storage. |
| Method Detail |
|---|
void abortChanges()
throws java.io.IOException
java.io.IOException
void add(S element)
throws java.io.IOException
element - add new element at the end
java.io.IOException - any IO errors
void addAll(long index,
java.util.List<S> elements)
throws java.io.IOException
elements - adds a list of elements at the current location in order they
appear in the list
java.io.IOException - any IO errors
void add(long index,
S... elements)
throws java.io.IOException
elements - array of elements to add
java.io.IOException - any IO errors
void remove(long index)
throws java.io.IOException
java.io.IOException - any IO errors
void removeAll()
throws java.io.IOException
java.io.IOException
void removeAll(java.util.Collection<R> elements)
throws java.io.IOException
Bulk remove, that removes several elements from the collection. The elements that are part of the collection, must have been created by the underlying capture session associated with this interface. For example FilePackets retain certain information about the position within the file, the packet came from and this information is needed to efficiently perform the operation.
Note that it is typically a lot more efficient to use bulk methods instead of doing the same work one iteration at a time. The implementation can use certain optimazations to perform the task at hand as efficiently as possible.
elements - collection of segments to be removed from the underlying storage
java.io.IOException - any IO errors
void removeAll(long index,
long count)
throws java.io.IOException
count - number of elements to remove from the current position on
java.io.IOException - any IO errors
void removeAll(R... elements)
throws java.io.IOException
elements - offset of the region to be removed
java.io.IOException - any IO errors
void replace(long index,
S element)
throws java.io.IOException
element - element containing new data
java.io.IOException - any IO errors
void retainAll(java.util.List<R> elements)
throws java.io.IOException
Bulk remove, that removes all records other then the ones found in the list. The records that are part of the list, must have been created by the underlying capture session associated with this interface. For example FilePackets retain certain information about the position within the file, the packet came from and this information is needed to efficiently perform the operation.
The retained elements are reorder to match the order of as specified by the list's order. Therefore it is important order the records to be retained in a specificaly user defined order. Note you can always use Collections.sort method to sort the list easily if needed.
elements - collection of elements to be retained in the underlying storage
java.io.IOException - any IO errors
void retainAll(R... elements)
throws java.io.IOException
Bulk remove, that removes all records other then the ones found in the array. The records that are part of the collection, must have been created by the underlying capture session associated with this interface. For example FilePackets retain certain information about the position within the file, the packet came from and this information is needed to efficiently perform the operation.
The retained elements are reorder to match the order of as specified in the array.
elements - array of elements to be retained in the underlying storage
java.io.IOException - any IO errors
void set(long index,
S element)
throws java.io.IOException
index - index of the element to affectelement - element that will replace the element at the index position
java.io.IOException - any IO errors
void swap(R dst,
R src)
throws java.io.IOException
dst - source record will be copied into this destination record's spacesrc - destination record will be copied into this source record's space
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||