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 Details

    • lookup

      The contract of this method is that the implementation returns an enumeration of information objects with the index column matching the key. If there are no matching information objects, the method should return an empty enumeration rather than null. When null 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

      Index add(AbstractData key, InfoObject row)
      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 the remove method followed by the add method for the changed information object. The Index returned is an updated index or null 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

      Index remove(AbstractData key, InfoObject row)
      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 invokes remove followed by add for the changed information object. The Index returned is an updated index or null 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.