Package com.oss.asn1
Class IndexedInfoObjectSet
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractContainer
com.oss.asn1.SequenceOf
com.oss.asn1.InfoObjectSet
com.oss.asn1.IndexedInfoObjectSet
- All Implemented Interfaces:
com.oss.asn1.Sizeable
,Serializable
,Cloneable
,Iterable
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:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.IndexedInfoObjectSet
(InfoObject[] objects, int flags) Construct an instance of IndexedInfoObjectSet from an array of information objects and flags.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). -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(InfoObject element) Deprecated.void
addObject
(InfoObject element) Add an information object at the end of the InfoObjectSet container if it is extensible.void
Delete the current index (if any).getIndex()
Return theIndex
that is currently active.void
insertElement
(InfoObject element, int atIndex) Deprecated.As of release 8.0 replaced byinsertObject(InfoObject, int)
void
insertObject
(InfoObject element, int atIndex) Insert an information object into the container at the index if it is extensible.lookup
(Enumeration cursor, int fieldIndex, AbstractData value) Find the Enumeration which identifies the info object(s) by the field index and the AbstractData value.void
remove
(int index) Remove the information object identified by its index from the container.void
Deprecated.As of release 8.0 replaced byremoveAllObjects()
void
Remove all information objects from the container.void
removeElement
(InfoObject element) Deprecated.As of release 8.0 replaced byremoveObject(InfoObject)
void
removeObject
(InfoObject element) Remove the information object, which matches the input object, from the container.void
setElement
(InfoObject element, int atIndex) Deprecated.As of release 8.0 replaced bysetObject(InfoObject, int)
void
setObject
(InfoObject element, int atIndex) Set the Element at the index in the container to the new element.Methods inherited from class com.oss.asn1.InfoObjectSet
getObject, isExtensible
Methods inherited from class com.oss.asn1.SequenceOf
add, asCollection, equalTo, get, insert, iterator, remove, set
Methods inherited from class com.oss.asn1.AbstractContainer
clone, delete, elements, getSize, hashCode, size
Methods inherited from class com.oss.asn1.AbstractData
equals, getTypeInfo, isEncodable, isPDU, isValid, toString, toString
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IndexedInfoObjectSet
public IndexedInfoObjectSet()The default constructor. -
IndexedInfoObjectSet
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
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 theindexByXXX
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 classInfoObjectSet
- 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
Add an information object at the end of the InfoObjectSet container if it is extensible. InvokesIndex.add()
to update the index (if any).null
, returned by theadd
method, instructs theIndexedInfoObjectSet
to abort indexing.- Overrides:
addObject
in classInfoObjectSet
- Parameters:
element
- the object to add.
-
addElement
Deprecated.As of release 8.0 replaced byaddObject(InfoObject)
Add an information object at the end of the InfoObjectSet container if it is extensible. InvokesIndex.add()
to update the index (if any).null
, returned by theadd
method, instructs theIndexedInfoObjectSet
to abort indexing.- Overrides:
addElement
in classInfoObjectSet
- Parameters:
element
- the object to add.
-
insertObject
Insert an information object into the container at the index if it is extensible. InvokesIndex.add()
to update the index (if any).null
, returned by theadd
method, instructs theIndexedInfoObjectSet
to abort indexing.- Overrides:
insertObject
in classInfoObjectSet
- Parameters:
element
- the object to insert.atIndex
- the slot to insert the object into.
-
insertElement
Deprecated.As of release 8.0 replaced byinsertObject(InfoObject, int)
Insert an information object into the container at the index if it is extensible. InvokesIndex.add()
to update the index (if any).null
, returned by theadd
method, instructs theIndexedInfoObjectSet
to abort indexing.- Overrides:
insertElement
in classInfoObjectSet
- Parameters:
element
- the object to insert.atIndex
- the slot to insert the object into.
-
removeObject
Remove the information object, which matches the input object, from the container. The match is identified by theequals
method. InvokesIndex.remove()
to update the index (if any).null
, returned by theremove
method, instructs theIndexedInfoObjectSet
to abort indexing.- Overrides:
removeObject
in classInfoObjectSet
- Parameters:
element
- the element to remove.
-
removeElement
Deprecated.As of release 8.0 replaced byremoveObject(InfoObject)
Remove the information object, which matches the input object, from the container. The match is identified by theequals
method. InvokesIndex.remove()
to update the index (if any).null
, returned by theremove
method, instructs theIndexedInfoObjectSet
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 classAbstractContainer
- 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 classInfoObjectSet
-
removeAllElements
Deprecated.As of release 8.0 replaced byremoveAllObjects()
Remove all information objects from the container. Container becomes empty.- Overrides:
removeAllElements
in classAbstractContainer
-
setObject
Set the Element at the index in the container to the new element. Update the index (if any).- Overrides:
setObject
in classInfoObjectSet
- Parameters:
element
- the new object to set.atIndex
- the index to set the object at.
-
setElement
Deprecated.As of release 8.0 replaced bysetObject(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 thereset
method of theIndex
and marks that the information object set is no longer indexed. -
getIndex
Return theIndex
that is currently active. Normally, this is the index that was created by the last invocation of theindexByXXX
method of theIndexedInfoObjectSet
.- Returns:
- the current index or
null
if the information object set has not been indexed yet.
-
addObject(InfoObject)