Package com.oss.metadata
Class MemberList
java.lang.Object
com.oss.metadata.MemberList
- Direct Known Subclasses:
HashMapMemberList
The MemberList class represents the properties of named lists
and enumeration lists (INTEGER, BIT STRING and ENUMERATED).
Each member of the list consists of a value and a name. For example,
Colors ::= INTEGER {red(0), blue(1), green(2)}
- Since:
- ASN.1/Java 2.1
-
Method Summary
Modifier and TypeMethodDescriptionint
count()
Return the count of the values on the list.int
getIndex
(long value) Return the index of the value on the named list.getMember
(int index) Return the metadata for the value at the i-th index, where index begins at zero (0).getMemberName
(long value) Return the name associated with the value and null otherwise.getMemberValue
(String name) Return the value associated with a name and null otherwise.long
getValue
(int i) Return the value at the i-th index of the list.
-
Method Details
-
getMemberName
Return the name associated with the value and null otherwise.- Parameters:
value
- a numerical value- Returns:
- member name associated with the value or null if the value is not on the list.
-
getIndex
public int getIndex(long value) Return the index of the value on the named list. The first valid index is zero (0). A return value of -1 indicates that the value could not be found.- Parameters:
value
- a numerical value- Returns:
- position of the value in the list or -1 if the value is not on the list.
-
getValue
public long getValue(int i) Return the value at the i-th index of the list.- Parameters:
i
- the index- Returns:
- i-th value in the list, where first index is 0.
-
getMember
Return the metadata for the value at the i-th index, where index begins at zero (0).- Parameters:
index
- an index- Returns:
- the member at a given index.
-
count
public int count()Return the count of the values on the list.- Returns:
- the number of elements in the list.
-
getMemberValue
Return the value associated with a name and null otherwise.- Parameters:
name
- the symbolic name.- Returns:
- member value associated with the name or null if the value is not on the list.
-