public class Vector_Object extends Object implements Serializable
Much faster because not synchronized and no cast - Does not double in size each time
| Modifier and Type | Field and Description |
|---|---|
protected int |
current_item |
| Constructor and Description |
|---|
Vector_Object() |
Vector_Object(int number) |
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(Object value)
add an item
|
void |
clear()
clear the array
|
boolean |
contains(Object value)
see if value present
|
Object |
elementAt(int id)
return element at
|
Object[] |
get()
extract underlying data
|
protected static int |
incrementSize(int increment_size) |
Object |
pull()
pull item from top as in LIFO stack
|
void |
push(Object value)
put item at top as in LIFO stack
|
void |
removeElementAt(int id)
remove element at
|
void |
resetToCheckpoint()
used to store end of PDF components
|
void |
restoreFromStream(ByteArrayInputStream bis)
method to deserialize each object in the input stream
|
void |
set(Object[] new_items)
replace underlying data
|
void |
setCheckpoint()
used to rollback array to point
|
void |
setElementAt(Object new_name,
int id)
set an element
|
int |
size()
return the size+1 as in last item (so an array of 0 values is 1)
|
void |
trim() |
void |
writeToStream(ByteArrayOutputStream bos)
method to serialize each element in this collection
|
public Vector_Object()
public Vector_Object(int number)
public void resetToCheckpoint()
public void setCheckpoint()
protected static int incrementSize(int increment_size)
public final Object[] get()
public final Object pull()
public final void push(Object value)
public final boolean contains(Object value)
public final void addElement(Object value)
public final void setElementAt(Object new_name, int id)
public final Object elementAt(int id)
public final void set(Object[] new_items)
public final void clear()
public final int size()
public final void removeElementAt(int id)
public void writeToStream(ByteArrayOutputStream bos) throws IOException
NOT PART OF API and subject to change (DO NOT USE)
bos - - the output stream to write the objects out toIOExceptionpublic void restoreFromStream(ByteArrayInputStream bis) throws IOException, ClassNotFoundException
NOT PART OF API and subject to change (DO NOT USE)
bis - - the input stream to read fromIOExceptionClassNotFoundExceptionpublic void trim()
Copyright © 2017. All rights reserved.