accept
public Object accept(ICOSVisitor visitor)
throws COSVisitorException
visitor pattern double dispatch method.
- accept in interface COSBase
visitor
- The object to notify when visiting this object.
- any object, depending on the visitor implementation, or null
add
public void add(int i,
COSBase object)
Add the specified object at the ith location and push the rest to the
right.
i
- The index to add at.object
- The object to add at that index.
add
public void add(COSBase object)
This will add an object to the array.
object
- The object to add to the array.
add
public void add(COSObjectable object)
This will add an object to the array.
object
- The object to add to the array.
addAll
public void addAll(Collection objectsList)
This will add an object to the array.
objectsList
- The object to add to the array.
addAll
public void addAll(int i,
Collection objectList)
Add the specified object at the ith location and push the rest to the
right.
i
- The index to add at.objectList
- The object to add at that index.
addAll
public void addAll(COSArray objectList)
This will add all objects to this array.
objectList
- The objects to add.
clear
public void clear()
This will remove all of the objects in the collection.
get
public COSBase get(int index)
This will get an object from the array. This will NOT derefernce
the COS object.
index
- The index into the array to get the object.
- The object at the requested index.
getInt
public int getInt(int index)
Get the value of the array as an integer.
index
- The index into the list.
- The value at that index or -1 if it is null.
getInt
public int getInt(int index,
int defaultValue)
Get the value of the array as an integer, return the default if it does
not exist.
index
- The value of the array.defaultValue
- The value to return if the value is null.
- The value at the index or the defaultValue.
getName
public String getName(int index)
Get the value of the array as a string.
index
- The index into the array.
- The name converted to a string or null if it does not exist.
getName
public String getName(int index,
String defaultValue)
Get an entry in the array that is expected to be a COSName.
index
- The index into the array.defaultValue
- The value to return if it is null.
- The value at the index or defaultValue if none is found.
getObject
public COSBase getObject(int index)
This will get an object from the array. This will dereference the object.
If the object is COSNull then null will be returned.
index
- The index into the array to get the object.
- The object at the requested index.
getString
public String getString(int index)
Get the value of the array as a string.
index
- The index into the array.
- The string or null if it does not exist.
getString
public String getString(int index,
String defaultValue)
Get an entry in the array that is expected to be a COSName.
index
- The index into the array.defaultValue
- The value to return if it is null.
- The value at the index or defaultValue if none is found.
growToSize
public void growToSize(int size)
This will add null values until the size of the array is at least
as large as the parameter. If the array is already larger than the
parameter then nothing is done.
size
- The desired size of the array.
growToSize
public void growToSize(int size,
COSBase object)
This will add the object until the size of the array is at least
as large as the parameter. If the array is already larger than the
parameter then nothing is done.
size
- The desired size of the array.object
- The object to fill the array with.
indexOf
public int indexOf(COSBase object)
This will return the index of the entry or -1 if it is not found.
object
- The object to search for.
- The index of the object or -1.
iterator
public Iterator iterator()
Get access to the list.
- an iterator over the array elements
remove
public COSBase remove(int i)
This will remove an element from the array.
i
- The index of the object to remove.
- The object that was removed.
remove
public boolean remove(COSBase o)
This will remove an element from the array.
o
- The object to remove.
- The object that was removed.
removeAll
public void removeAll(Collection objectsList)
This will remove all of the objects in the collection.
objectsList
- The list of objects to remove from the collection.
retainAll
public void retainAll(Collection objectsList)
This will retain all of the objects in the collection.
objectsList
- The list of objects to retain from the collection.
set
public void set(int index,
int intVal)
This will set an object at a specific index.
index
- zero based index into array.intVal
- The object to set.
set
public void set(int index,
COSBase object)
This will set an object at a specific index.
index
- zero based index into array.object
- The object to set.
set
public void set(int index,
COSObjectable object)
This will set an object at a specific index.
index
- zero based index into array.object
- The object to set.
setFloatArray
public void setFloatArray(float[] value)
Clear the current contents of the COSArray and set it with the float[].
value
- The new value of the float array.
setInt
public void setInt(int index,
int value)
Set the value in the array as an integer.
index
- The index into the array.value
- The value to set.
setName
public void setName(int index,
String name)
Set the value in the array as a name.
index
- The index into the array.name
- The name to set in the array.
setString
public void setString(int index,
String string)
Set the value in the array as a string.
index
- The index into the array.string
- The string to set in the array.
size
public int size()
This will get the size of this array.
- The number of elements in the array.
toFloatArray
public float[] toFloatArray()
This will take an COSArray of numbers and convert it to a float[].
- This COSArray as an array of float numbers.
toString
public String toString()