public class CircularArray extends Object
| Constructor and Description |
|---|
CircularArray(int capacity)
Creates an array of capacity size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Object obj)
Adds a new object to the array.
|
int |
capacity()
Returns the number of objects stored in the array.
|
void |
clear()
Clears out the contents of the array.
|
boolean |
contains(Object obj)
Returns true if the array contains the specified object.
|
Object |
get(int index)
Gets the object at the specified index.
|
int |
indexOf(Object obj)
Returns the index of the specified object
|
String |
internalRep() |
boolean |
isEmpty()
Returns true if the array has no elements;
|
void |
remove(Object obj)
Removes the specified object from the array
|
void |
resize(int newCapacity)
Resizes the array to the specified new size.
|
int |
size()
Returns the number of objects stored in the array.
|
Object[] |
toArray()
Converts the array to an Object array.
|
String |
toString() |
public CircularArray(int capacity)
capacity - - size of the new arraypublic void clear()
public boolean isEmpty()
public void add(Object obj)
obj - - the object to be addedpublic int capacity()
public boolean contains(Object obj)
obj - the object to be checkedpublic Object get(int index)
index - the index of the object to be retrievedpublic int indexOf(Object obj)
obj - the object that is being searched forpublic void remove(Object obj)
i - the index of the object to be removedpublic void resize(int newCapacity)
newCapacity - the new capacity of the arraypublic int size()
public Object[] toArray()
public String internalRep()
Copyright © 2001–2015 Apache Cayenne. All rights reserved.