public class COSArray extends COSBase implements List<COSBase>
| Modifier and Type | Method and Description |
|---|---|
void |
accept(COSVisitor visitor)
Visitor pattern for the COS model objects
|
boolean |
add(COSBase object) |
boolean |
add(COSObjectable object)
Add an object to the array
|
void |
add(int index,
COSBase object) |
void |
add(int index,
COSObjectable object)
Add an object at the index location and push the rest to the right.
|
boolean |
addAll(Collection<? extends COSBase> objectsList) |
boolean |
addAll(COSArray objectList)
This will add all objects to this array.
|
boolean |
addAll(int i,
Collection<? extends COSBase> objectList) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
COSArray |
duplicate() |
boolean |
equals(Object o) |
COSBase |
get(int index)
Get an object from the array.
|
int |
getInt(int index)
Get the value of the array as an integer.
|
int |
getInt(int index,
int defaultValue)
Get the value of the array as an integer, return the default if it does not exist.
|
String |
getName(int index)
Get the value of the array as a string.
|
String |
getName(int index,
String defaultValue)
Get an entry in the array that is expected to be a COSName.
|
COSBase |
getObject(int index)
This will get an object from the array.
|
<T extends COSBase> |
getObject(int index,
Class<T> clazz)
This will get an object from the array.
|
String |
getString(int index)
Get the value of the array as a string.
|
String |
getString(int index,
String defaultValue)
Get an entry in the array that is expected to be a COSName.
|
COSArray |
growToSize(int size)
This will add null values until the size of the array is at least as large as the parameter.
|
COSArray |
growToSize(int size,
COSBase object)
This will add the object until the size of the array is at least as large as the parameter.
|
int |
hashCode() |
int |
indexOf(Object object) |
int |
indexOfObject(COSBase object)
This will return the index of the entry or -1 if it is not found.
|
boolean |
isEmpty() |
Iterator<COSBase> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<COSBase> |
listIterator() |
ListIterator<COSBase> |
listIterator(int index) |
COSBase |
remove(int i) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> objectsList) |
COSBase |
removeLast()
Removes the last object of the array
|
boolean |
removeObject(COSBase o)
This will remove an element from the array.
|
boolean |
retainAll(Collection<?> objectsList) |
COSBase |
set(int index,
COSBase object) |
void |
set(int index,
COSObjectable object)
Set an object at a specific index.
|
void |
setFloatArray(float[] value)
Clear the current contents of the COSArray and set it with the float[].
|
void |
setString(int index,
String string)
Set the value in the array as a string.
|
int |
size() |
List<COSBase> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
float[] |
toFloatArray()
This will take an COSArray of numbers and convert it to a float[].
|
List<? extends COSBase> |
toList() |
String |
toString() |
COSArray |
trimToSize(int size)
trims the array to the given size
|
getCOSObject, hasId, id, idIfAbsentclone, finalize, getClass, notify, notifyAll, wait, wait, waitreplaceAll, sort, spliteratorparallelStream, removeIf, streampublic COSArray()
public COSArray(COSBase... items)
public boolean add(COSObjectable object)
object - The object to add to the array.List.add(Object)public boolean add(COSBase object)
public void add(int index,
COSObjectable object)
index - The index to add at.object - The object to add at that index.List.add(int, Object)public void clear()
public boolean removeAll(Collection<?> objectsList)
public boolean retainAll(Collection<?> objectsList)
public boolean addAll(Collection<? extends COSBase> objectsList)
public boolean addAll(COSArray objectList)
objectList - The objects to add.public boolean addAll(int i,
Collection<? extends COSBase> objectList)
public void set(int index,
COSObjectable object)
index - zero based index into array.object - The object to set.public COSBase getObject(int index)
index - The index into the array to get the object.public <T extends COSBase> T getObject(int index, Class<T> clazz)
index - clazz - public COSBase get(int index)
get in interface List<COSBase>index - The index into the array to get the object.List.get(int)public int getInt(int index)
index - The index into the list.public int getInt(int index,
int defaultValue)
index - The value of the array.defaultValue - The value to return if the value is null.public String getName(int index)
index - The index into the array.public String getName(int index, String defaultValue)
index - The index into the array.defaultValue - The value to return if it is null.public void setString(int index,
String string)
index - The index into the array.string - The string to set in the array.public String getString(int index)
index - The index into the array.public String getString(int index, String defaultValue)
index - The index into the array.defaultValue - The value to return if it is null.public int size()
public COSBase removeLast()
public boolean remove(Object o)
public boolean removeObject(COSBase o)
o - The object to remove.true if the object was removed, false otherwisepublic ListIterator<COSBase> listIterator()
listIterator in interface List<COSBase>public ListIterator<COSBase> listIterator(int index)
listIterator in interface List<COSBase>public int lastIndexOf(Object o)
lastIndexOf in interface List<COSBase>public int indexOfObject(COSBase object)
object - The object to search for.public COSArray growToSize(int size)
size - The desired size of the array.public COSArray growToSize(int size, COSBase object)
size - The desired size of the array.object - The object to fill the array with.public COSArray trimToSize(int size)
size - public float[] toFloatArray()
public void setFloatArray(float[] value)
value - The new value of the float array.public boolean isEmpty()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<COSBase>containsAll in interface List<COSBase>public void accept(COSVisitor visitor) throws IOException
COSBaseaccept in class COSBaseIOExceptionpublic boolean equals(Object o)
public int hashCode()
Copyright © 2020 sejda. All rights reserved.