Package org.webpki.cbor
Class CBORArray
java.lang.Object
org.webpki.cbor.CBORObject
org.webpki.cbor.CBORArray
- All Implemented Interfaces:
Cloneable
Class for holding CBOR
array
objects.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(CBORObject cborObject) Appends object to the array.get
(int index) Retrieves object at a specific position.int
size()
Returns the size of the array.toArray()
Returns the entire array.Methods inherited from class org.webpki.cbor.CBORObject
checkForUnread, clone, decode, decode, encode, equals, getArray, getBigInteger, getBoolean, getByte, getBytes, getDouble, getFloat, getInt, getLong, getMap, getShort, getString, getTag, getType, getUnsignedByte, getUnsignedInt, getUnsignedLong, getUnsignedShort, hashCode, isNull, scan, toDiagnosticNotation, toString
-
Constructor Details
-
CBORArray
public CBORArray()Creates an empty CBOR array[]
.
-
-
Method Details
-
size
public int size()Returns the size of the array.- Returns:
- The number of objects in the array
-
get
Retrieves object at a specific position.- Parameters:
index
- The position (0..size()-1)- Returns:
- CBOR object
-
add
Appends object to the array.- Parameters:
cborObject
- Object to be appended to the array.- Returns:
this
-
toArray
Returns the entire array.- Returns:
- Array of CBOR objects
-