public class GrowableArray<E>
extends java.lang.Object
Constructor and Description |
---|
GrowableArray(int inisize,
int inc)
Construct an array with initial size inisize
and increment inc
|
Modifier and Type | Method and Description |
---|---|
void |
addArrayElement(E o)
Creates a new array from objarray adding an element o.
|
void |
clear() |
E |
getElement(int j)
Get the element at index j.
|
int |
getSize() |
void |
insertArrayElement(int j,
E o)
Creates a new array from objarray inserting a new element
at index j with value o.
|
void |
printArray()
Displays the size of objarray.
|
E |
removeArrayElement(E o)
Creates a new array from objarray skipping the first element
with the same value as o.
|
E |
removeArrayElement(int j)
Creates a new array from objarray skipping element j.
|
boolean |
setElement(int j,
E o)
Set the element at index j.
|
void |
shrink() |
E[] |
toArray(E[] a) |
public GrowableArray(int inisize, int inc)
public int getSize()
public void shrink()
public void printArray()
public E getElement(int j)
public boolean setElement(int j, E o)
public E removeArrayElement(int j)
public E removeArrayElement(E o)
public void addArrayElement(E o)
public void insertArrayElement(int j, E o)
public void clear()