|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.util.PackedIntVector
public class PackedIntVector
PackedIntVector stores a two-dimensional array of integers in which the number of columns is fixed but the number of rows may be changed on demand. It features a buffer-gap representation so rows in the same vicinity may be added or removed quickly and additional gaps in each column so the values in ranges of rows of the same column may be incremented or decremented quickly.
| Constructor Summary | |
|---|---|
PackedIntVector()
Create a new PackedIntVector with a single column. |
|
PackedIntVector(int inNumColumns)
Create a new PackedIntVector with the specified number of columns. |
|
PackedIntVector(int futureRows,
int inNumColumns)
Create a new PackedIntVector with the specified number of columns and space already set aside to add at least the specified number of rows. |
|
| Method Summary | |
|---|---|
void |
applyColumnDelta(int inColumn,
int inValue)
Increment all values in the specified column by the specified value. |
void |
applyColumnDelta(int inColumn,
int inFirstRow,
int inValue)
Increment all values in the specified column at or below the specified row number by the specified value. |
void |
applyColumnDelta(int inColumn,
int inFirstRow,
int inNumRows,
int inValue)
Increment the values in the specified column for the specified number of rows beginning at the specified row by the specified value. |
void |
ensureCapacity(int inNumNewRows)
Increase the internal storage of the PackedIntVector to be large enough to hold at least the specified number of rows. |
int |
newRow()
Add a row to the bottom of the PackedIntVector, returning the number of the new row. |
int |
newRow(int[] inValues)
Add a row to the bottom of the PackedIntVector, returning the number of the new row. |
void |
newRowAt(int inRow)
Add a row above (before) the specified row of the PackedIntVector. |
void |
newRowAt(int inRow,
int[] inValues)
Add a row above (before) the specified row of the PackedIntVector. |
int |
numColumns()
Return the number of columns that the PackedIntVector contains. |
int |
numRows()
Return the number of rows that the PackedIntVector currently contains. |
void |
removeAllRows()
Remove all rows from the PackedIntVector, leaving it with 0 rows. |
void |
removeRowAt(int inRow)
Remove the specified row of the PackedIntVector. |
void |
setValue(int inRow,
int[] inValues)
Set the value in a specified row to a copy of the values in the provided array, which must be at least as large as the number of columns in the PackedIntVector, or null, in which case it will be treated as all zeroes. |
void |
setValue(int inRow,
int inColumn,
int inValue)
Set the value of a specified row and column to the specified value. |
int[] |
valueAt(int inRow)
Return a new array of integers containing a copy of the values in the specified row. |
int |
valueAt(int inRow,
int inColumn)
Return the value at the specified row and column. |
int[] |
valueAt(int inRow,
int[] ioStorage)
Fill in the specified array of integers, which must be at least as large as the number of the columns in the PackedIntVector, with a copy of the specified row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackedIntVector()
public PackedIntVector(int inNumColumns)
public PackedIntVector(int futureRows,
int inNumColumns)
| Method Detail |
|---|
public int valueAt(int inRow,
int inColumn)
public int[] valueAt(int inRow)
public int[] valueAt(int inRow,
int[] ioStorage)
public final void ensureCapacity(int inNumNewRows)
public final int newRow()
public final int newRow(int[] inValues)
public final void newRowAt(int inRow)
public final void newRowAt(int inRow,
int[] inValues)
public final void removeRowAt(int inRow)
public final void setValue(int inRow,
int inColumn,
int inValue)
public final void setValue(int inRow,
int[] inValues)
public final void applyColumnDelta(int inColumn,
int inValue)
public final void applyColumnDelta(int inColumn,
int inFirstRow,
int inValue)
public final void applyColumnDelta(int inColumn,
int inFirstRow,
int inNumRows,
int inValue)
public final void removeAllRows()
public final int numColumns()
public final int numRows()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||