|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.text.PackedIntVector
class PackedIntVector
PackedIntVector stores a two-dimensional array of integers, optimized for inserting and deleting rows and for offsetting the values in segments of a given column.
| Constructor Summary | |
|---|---|
PackedIntVector(int columns)
Creates a new PackedIntVector with the specified width and a height of 0. |
|
| Method Summary | |
|---|---|
void |
adjustValuesBelow(int startRow,
int column,
int delta)
Increments all values in the specified column whose row >= the specified row by the specified delta. |
void |
deleteAt(int row,
int count)
Deletes the specified number of rows starting with the specified row. |
int |
getValue(int row,
int column)
Returns the value at the specified row and column. |
void |
insertAt(int row,
int[] values)
Inserts a new row of values at the specified row offset. |
void |
setValue(int row,
int column,
int value)
Sets the value at the specified row and column. |
int |
size()
Returns the number of rows in the PackedIntVector. |
int |
width()
Returns the width of the PackedIntVector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackedIntVector(int columns)
columns - the width of the PackedIntVector.| Method Detail |
|---|
public int getValue(int row,
int column)
row - the index of the row to return.column - the index of the column to return.
IndexOutOfBoundsException - if the row is out of range
(row < 0 || row >= size()) or the column is out of range
(column < 0 || column >= width()).
public void setValue(int row,
int column,
int value)
row - the index of the row to set.column - the index of the column to set.
IndexOutOfBoundsException - if the row is out of range
(row < 0 || row >= size()) or the column is out of range
(column < 0 || column >= width()).
public void adjustValuesBelow(int startRow,
int column,
int delta)
startRow - the row at which to begin incrementing.
This may be == size(), which case there is no effect.column - the index of the column to set.
IndexOutOfBoundsException - if the row is out of range
(startRow < 0 || startRow > size()) or the column
is out of range (column < 0 || column >= width()).
public void insertAt(int row,
int[] values)
row - the row above which to insert the new row.
This may be == size(), which case the new row is added
at the end.values - the new values to be added. If this is null,
a row of zeroes is added.
IndexOutOfBoundsException - if the row is out of range
(row < 0 || row > size()) or if the length of the
values array is too small (values.length < width()).
public void deleteAt(int row,
int count)
row - the index of the first row to be deleted.count - the number of rows to delete.
IndexOutOfBoundsException - if any of the rows to be deleted
are out of range (row < 0 || count < 0 ||
row + count > size()).public int size()
public int width()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||