Package com.oss.asn1

Class IndexedInfoObjectSet

All Implemented Interfaces:
com.oss.asn1.Sizeable, Serializable, Cloneable, Iterable

public abstract class IndexedInfoObjectSet extends InfoObjectSet
The IndexedInfoObjectSet class represents an information object set of an information object class that is optionally indexed. Indexing the information object set improves the speed of the lookup operation when the information object set is searched during automatic decoding of open types.
Since:
ASN.1/Java 1.4-beta C
See Also:
  • Constructor Details

    • IndexedInfoObjectSet

      public IndexedInfoObjectSet()
      The default constructor.
    • IndexedInfoObjectSet

      public IndexedInfoObjectSet(InfoObject[] objects, int flags)
      Construct an instance of IndexedInfoObjectSet from an array of information objects and flags. Currently the only flag supported is EXTENSIBLE.
      Parameters:
      objects - an array of InfoObject objects.
      flags - all flags to be used "OR"ed together, 0 indicates no flags.
    • IndexedInfoObjectSet

      public IndexedInfoObjectSet(InfoObject[] objects, int flags, String modname, String osetname)
      Construct an instance of IndexedInfoObjectSet from an array of information objects, flags and a name (in 2 parts). Currently the only flag supported is EXTENSIBLE.
      Parameters:
      objects - an array of InfoObject objects.
      flags - all flags to be used "OR"ed together, 0 indicates no flags.
      modname - the name of the ASN.1 module where this information object set is defined.
      osetname - the ASN.1 name of this information object set.
  • Method Details

    • lookup

      public Enumeration lookup(Enumeration cursor, int fieldIndex, AbstractData value) throws MetadataException
      Find the Enumeration which identifies the info object(s) by the field index and the AbstractData value. If there is an index, created by the indexByXXX method for the lookup field, the index is used for the lookup. Otherwise, matching rows are identified by the linear search procedure.
      Overrides:
      lookup in class InfoObjectSet
      Parameters:
      cursor - identifies one or several rows for a limited search, if it is null the entire InfoObjectSet is searched. Note, currently no checking is performed as to whether or not InfoObjects from "cursor" belong to 'this' InfoObjectSet.
      fieldIndex - identifies the field to be searched.
      value - identifies the value of the field to be searched.
      Returns:
      Enumeration that identifies InfoObject(s) containing the field at "fieldIndex" with "value", or null.
      Throws:
      MetadataException - if an error occurs.
    • addObject

      public void addObject(InfoObject element)
      Add an information object at the end of the InfoObjectSet container if it is extensible. Invokes Index.add() to update the index (if any). null, returned by the add method, instructs the IndexedInfoObjectSet to abort indexing.
      Overrides:
      addObject in class InfoObjectSet
      Parameters:
      element - the object to add.
    • addElement

      @Deprecated public void addElement(InfoObject element)
      Deprecated.
      As of release 8.0 replaced by addObject(InfoObject)
      Add an information object at the end of the InfoObjectSet container if it is extensible. Invokes Index.add() to update the index (if any). null, returned by the add method, instructs the IndexedInfoObjectSet to abort indexing.
      Overrides:
      addElement in class InfoObjectSet
      Parameters:
      element - the object to add.
    • insertObject

      public void insertObject(InfoObject element, int atIndex)
      Insert an information object into the container at the index if it is extensible. Invokes Index.add() to update the index (if any). null, returned by the add method, instructs the IndexedInfoObjectSet to abort indexing.
      Overrides:
      insertObject in class InfoObjectSet
      Parameters:
      element - the object to insert.
      atIndex - the slot to insert the object into.
    • insertElement

      @Deprecated public void insertElement(InfoObject element, int atIndex)
      Deprecated.
      As of release 8.0 replaced by insertObject(InfoObject, int)
      Insert an information object into the container at the index if it is extensible. Invokes Index.add() to update the index (if any). null, returned by the add method, instructs the IndexedInfoObjectSet to abort indexing.
      Overrides:
      insertElement in class InfoObjectSet
      Parameters:
      element - the object to insert.
      atIndex - the slot to insert the object into.
    • removeObject

      public void removeObject(InfoObject element)
      Remove the information object, which matches the input object, from the container. The match is identified by the equals method. Invokes Index.remove() to update the index (if any). null, returned by the remove method, instructs the IndexedInfoObjectSet to abort indexing.
      Overrides:
      removeObject in class InfoObjectSet
      Parameters:
      element - the element to remove.
    • removeElement

      @Deprecated public void removeElement(InfoObject element)
      Deprecated.
      As of release 8.0 replaced by removeObject(InfoObject)
      Remove the information object, which matches the input object, from the container. The match is identified by the equals method. Invokes Index.remove() to update the index (if any). null, returned by the remove method, instructs the IndexedInfoObjectSet to abort indexing.
      Parameters:
      element - the element to remove.
    • remove

      public void remove(int index)
      Remove the information object identified by its index from the container.
      Overrides:
      remove in class AbstractContainer
      Parameters:
      index - the index of the object to remove.
    • removeAllObjects

      public void removeAllObjects()
      Remove all information objects from the container. Container becomes empty.
      Overrides:
      removeAllObjects in class InfoObjectSet
    • removeAllElements

      @Deprecated public void removeAllElements()
      Deprecated.
      As of release 8.0 replaced by removeAllObjects()
      Remove all information objects from the container. Container becomes empty.
      Overrides:
      removeAllElements in class AbstractContainer
    • setObject

      public void setObject(InfoObject element, int atIndex)
      Set the Element at the index in the container to the new element. Update the index (if any).
      Overrides:
      setObject in class InfoObjectSet
      Parameters:
      element - the new object to set.
      atIndex - the index to set the object at.
    • setElement

      @Deprecated public void setElement(InfoObject element, int atIndex)
      Deprecated.
      As of release 8.0 replaced by setObject(InfoObject, int)
      Set the Element at the index in the container to the new element. Update the index (if any).
      Parameters:
      element - the new object to set.
      atIndex - the index to set the object at.
    • deleteIndex

      public void deleteIndex()
      Delete the current index (if any). The method invokes the reset method of the Index and marks that the information object set is no longer indexed.
    • getIndex

      public Index getIndex()
      Return the Index that is currently active. Normally, this is the index that was created by the last invocation of the indexByXXX method of the IndexedInfoObjectSet.
      Returns:
      the current index or null if the information object set has not been indexed yet.