Package com.oss.asn1
Interface Index
- All Known Implementing Classes:
DefaultIndex
public interface Index
The
Index
interface specifies the functionality, required
to implement indexing of the information object sets. Indexing the
information object sets that are referenced by component relation
constraints, imposed on open types, results in faster automatic decoding.
Implementation of lazy indexing or indexing by demand can also be done
via the Index interface.
If the Index interface is not implemented for an information object set
then linear lookup of information objects with a set is performed
during automatic decoding.- Since:
- ASN.1/Java 1.4-beta C
-
Method Summary
Modifier and TypeMethodDescriptionadd
(AbstractData key, InfoObject row) Add the information object to the index.lookup
(AbstractData key) The contract of this method is that the implementation returns an enumeration of information objects with the index column matching thekey
.remove
(AbstractData key, InfoObject row) Remove the information object from the index.reset()
Resets the index.
-
Method Details
-
lookup
The contract of this method is that the implementation returns an enumeration of information objects with the index column matching thekey
. If there are no matching information objects, the method should return an empty enumeration rather thannull
. Whennull
is returned by the lookup, it indicates that the method delegates the search to the caller. This method is called by the runtime when the coder resolves component relation constraints in order to detect the type of the value, carried by an open type.- Parameters:
key
- the value of index column to lookup.- Returns:
- information objects with the index column matching the
key
.
-
add
Add the information object to the index. This method is called by the runtime to update the index after the structural change in the information object set, like the addition of a new information object or the modification of an existing one. In the latter case the runtime invokes theremove
method followed by theadd
method for the changed information object. TheIndex
returned is an updated index ornull
if the addition of a new information object to the index fails for some reason.- Parameters:
key
- the value of the index column of the information object.row
- the information object to add.- Returns:
- modified index.
-
remove
Remove the information object from the index. This method is called by the runtime to update the index after the structural change in the information object set, like deletion or modification of an existing information object. In the latter case the runtime invokesremove
followed byadd
for the changed information object. TheIndex
returned is an updated index ornull
if deletion of the information object fails for some reason.- Parameters:
key
- the value of the index column of the information object.row
- the information object to delete.- Returns:
- modified index.
-
reset
Index reset()Resets the index.- Returns:
- empty index.
-