public class Grid extends mVector
When adding sequentially call the add(Object what,boolean lastInRow) method to add an object to the end of the current row. End a row either by calling endRow() or by setting "lastInRow" true when adding the last object to the row.
Modifier and Type | Field and Description |
---|---|
int |
columns
This holds the number of columns in the Grid.
|
int |
rows
This holds the number of rows in the Grid.
|
capacityIncrement, elementCount, elementData
serialVersionUID
Constructor and Description |
---|
Grid() |
Modifier and Type | Method and Description |
---|---|
Object |
add(Object what,
boolean lastInRow)
Add the object to the current row.
|
void |
addAll(mVector what)
Add all elements of the Vector parameter to the current row.
|
protected Object |
addToRow(mVector row,
Object what) |
void |
clear()
Clear the entire grid.
|
void |
endRow()
End the current row - all future add() calls will add objects to a new
row.
|
mVector |
getMostCurrentRow()
Return the Vector which represents the row which is currently being
added to (you are hardly likely to use this method).
|
void |
insertRow(Object[] what,
int atIndex)
Insert a complete row at certain point.
|
Grid |
last(Object toAdd) |
Grid |
newRow() |
Grid |
next(Object toAdd) |
Object |
objectAt(int index)
Return the Object stored at the index.
|
Object |
objectAt(int row,
int column)
Return the Object stored at the specified row and column.
|
void |
set(int row,
int column,
Object what)
Set the Object at a particluar row and column.
|
add, add, addAll, addAll, addAll, addAll, addCopiesFrom, cacheAllElements, compareTo, copied, copyCopiesFrom, copyFrom, copyInto, copyInto, del, find, get, getCopy, getCount, getFullCopy, getNew, insert, iterator, newVector, pop, push, size, toArray, toArray, toArray, toArray, toArray, toObjectArray, toString
add, addAll, addAll, addElement, capacity, clone, contains, containsAll, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, setElementAt, setSize, size, trimToSize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
public int columns
public int rows
public void endRow()
public Object add(Object what, boolean lastInRow)
public void insertRow(Object[] what, int atIndex)
what
- the objects to insert.atIndex
- the index to insert at.public void addAll(mVector what)
public void clear()
clear
in interface Collection
clear
in class mVector
public Object objectAt(int index)
public Object objectAt(int row, int column)
public mVector getMostCurrentRow()
public void set(int row, int column, Object what)
public Grid newRow()