|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper com.plumtree.uiinfrastructure.arraywrapper.PTGrowableSortedArrayWrapper
public class PTGrowableSortedArrayWrapper
MES- The PTGrowableSortedArrayWrapper
class is a subclass of
PSortedArrayWrapper. It offers some additional functionality- the ability
to add and remove rows "dynamically."
Field Summary | |
---|---|
protected int[] |
m_arrColumnIDs
MES- We store the mapping of column IDs, because we sometimes have to rebuild m_hashPropIDtoColumn |
protected int |
m_iPercentIncrease
MES- m_iPercentIncrease tells us how much we should grow by when we want to grow |
protected XPArrayList |
m_lstUnusedRowMapping
MES- m_lstUnusedRowMapping is a list of the empty rows. |
protected static int |
PTGSAW_MINIMUM_PCT_INCREASE
MES- PTGSAW_MINIMUM_PCT_INCREASE is the minimum percent increase for the array |
Fields inherited from class com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper |
---|
m_arrData, m_arrSort, m_bSortOptimized, m_hashPropIDtoColumn, m_lstRowMapping, PTSAW_NEWITEMSINFO_INDEX, PTSAW_NEWITEMSINFO_NEWVALUE, PTSAW_NEWITEMSINFO_PROPERTYID, PTSAW_SORT_ASCENDING, PTSAW_SORT_DESCENDING, PTSAW_SORT_ROW_DIRECTION, PTSAW_SORT_ROW_PROPID |
Constructor Summary | |
---|---|
PTGrowableSortedArrayWrapper()
|
Method Summary | |
---|---|
void |
AddRow(java.lang.Object[] row)
MES- Clients use the AddRow method to add a row to this array. |
protected void |
AddRowInternal(java.lang.Object[] row)
MES- AddRowInternal is an internal helper function that does the heavy lifting when adding a row. |
void |
AddRows(java.lang.Object[][] rows)
MES- AddRows is the bulk equivalent of AddRow- it lets clients add multiple rows in a bulk operation. |
void |
AddRowWithoutSort(java.lang.Object[] row)
ROB- Clients use the AddRow method to add a row to this array. |
protected int |
CalculateNextSize(int iNominalSize)
MES- CalculateNexSize is an internal helper function that figures out, based on the current size, what the next size would be (taking into account m_iPercentIncrease, etc.) |
void |
ClearArray()
JF- Clears the entire array of Data. |
protected boolean |
GrowInternalArrayIfNeeded(int iRowsToAdd)
MES- GrowInternalArrayIfNeeded is an internal helper function that checks if m_arrData is large enough to hold more rows, and makes it larger if needed. |
void |
Initialize(int[] arrColumnIDs,
java.lang.Object[][] arrData,
int[][] arrSort,
boolean bRequiresSort)
MES- Initialize is equivalent to the PTSortedArrayWrapper call of the same name |
void |
Initialize(int[] arrColumnIDs,
java.lang.Object[][] arrData,
int[][] arrSort,
boolean bRequiresSort,
int iInitialSize)
MES- Initialize is equivalent to the PTSortedArrayWrapper call of the same name |
void |
Initialize(int[] arrColumnIDs,
java.lang.Object[][] arrData,
int[][] arrSort,
boolean bRequiresSort,
int iInitialSize,
int iPercentIncrease)
MES- Initialize is equivalent to the PTSortedArrayWrapper call of the same name |
void |
RemoveRow(int iRowID)
MES- RemoveRow lets the client indicate the row number of a row to remove. |
void |
RemoveRows(int[] iRowIDs)
MES- RemoveRows is the bulk anologue of RemoveRow |
protected java.lang.Object[][] |
ResizeArray(java.lang.Object[][] arrData,
int iNewRowcount,
int iColcount)
MES- ResizeArray is an internal helper function that changes the number of rows in an array (by creating a new array and copying the data over.) |
void |
SortArray()
ROB- Resort the internal array. |
Methods inherited from class com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper |
---|
ContainsPropID, GetCount, GetItem, GetSort, MapColumnIDs, SetItem, SetItems, Sort, SortInternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.plumtree.uiinfrastructure.arraywrapper.IPTGrowableSortedArrayWrapperRO |
---|
GetCount, GetItem, GetSort |
Field Detail |
---|
protected static final int PTGSAW_MINIMUM_PCT_INCREASE
protected XPArrayList m_lstUnusedRowMapping
protected int[] m_arrColumnIDs
protected int m_iPercentIncrease
Constructor Detail |
---|
public PTGrowableSortedArrayWrapper()
Method Detail |
---|
public void AddRowWithoutSort(java.lang.Object[] row)
SortArray
to re-sort after adding multiple entries
Added as to fix bug #51045:
row
- is the data that the row should hold. The number of
entries in row MUST equal the number of columns in m_arrData.public void SortArray()
AddRowWithoutSort
multiple times. This is
an alternative to calling AddRows with a 2d array.
Added as to fix bug #51045:
public void AddRow(java.lang.Object[] row)
row
- is the data that the row should hold. The number of
entries in row MUST equal the number of columns in m_arrData.public void AddRows(java.lang.Object[][] rows)
rows
- is an array of row arrays. The first index is the rownum,
the second index is the row data. This is a little confusing, but it
makes sense- AddRows takes an array of the items passed to AddRow.public void ClearArray()
public void Initialize(int[] arrColumnIDs, java.lang.Object[][] arrData, int[][] arrSort, boolean bRequiresSort)
Initialize
in class PTSortedArrayWrapper
arrColumnIDs
- contains the Property IDs for each column in
arrData. The size of arrColumnIDs should be equal to the number
of columns in arrData.arrData
- contains the actual data to be stored and manipulated.
The index convention matches the Plumtree server- the first
index is column, and the second is the row, like
arrData[iColIndex][iRowIndex]arrSort
- is a 2D int array of PropertyIDs to sort by. It should
contain a column for each sort. The first row holds the
PropertyID, and the second row holds the sort direction,
PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDINGbRequiresSort
- indicates if arrData is already sorted as indicated
by arrSort. If the client knows that the data is already
sorted, we can skip the sort, and we can also optimize access.public void Initialize(int[] arrColumnIDs, java.lang.Object[][] arrData, int[][] arrSort, boolean bRequiresSort, int iInitialSize)
arrColumnIDs
- contains the Property IDs for each column in
arrData. The size of arrColumnIDs should be equal to the number
of columns in arrData.arrData
- contains the actual data to be stored and manipulated.
The index convention matches the Plumtree server- the first
index is column, and the second is the row, like
arrData[iColIndex][iRowIndex]arrSort
- is a 2D int array of PropertyIDs to sort by. It should
contain a column for each sort. The first row holds the
PropertyID, and the second row holds the sort direction,
PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDINGbRequiresSort
- indicates if arrData is already sorted as indicated
by arrSort. If the client knows that the data is already
sorted, we can skip the sort, and we can also optimize access.iInitialSize
- indicates the initial size of the array, if the client
wishes to preallocate some rows.public void Initialize(int[] arrColumnIDs, java.lang.Object[][] arrData, int[][] arrSort, boolean bRequiresSort, int iInitialSize, int iPercentIncrease)
arrColumnIDs
- contains the Property IDs for each column in
arrData. The size of arrColumnIDs should be equal to the number
of columns in arrData.arrData
- contains the actual data to be stored and manipulated.
The index convention matches the Plumtree server- the first
index is column, and the second is the row, like
arrData[iColIndex][iRowIndex]arrSort
- is a 2D int array of PropertyIDs to sort by. It should
contain a column for each sort. The first row holds the
PropertyID, and the second row holds the sort direction,
PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDINGbRequiresSort
- indicates if arrData is already sorted as indicated
by arrSort. If the client knows that the data is already
sorted, we can skip the sort, and we can also optimize access.iInitialSize
- indicates the initial size of the array, if the client
wishes to preallocate some rows.iPercentIncrease
- allows the client to indicate the amount by which
we should grow the array when we add rows. It's expressed as a percent,
e.g. a client would pass in 300 to have the array triple in size when
expanding. Values less than 110 are replaced with 110.public void RemoveRow(int iRowID)
iRowID
- is the row ID of the row to remove. Note that this is the
row ID in the SORTED array, we must dereference it to get the "real"
row number.public void RemoveRows(int[] iRowIDs)
iRowIDs
- is an int array of the row IDs to removeprotected void AddRowInternal(java.lang.Object[] row)
row
- is the row to add, in the same format as is passed to
AddRow.protected int CalculateNextSize(int iNominalSize)
iNominalSize
- is the current nominal size- the function
calculates the "next" size bigger than this size.
protected boolean GrowInternalArrayIfNeeded(int iRowsToAdd)
iRowsToAdd
- is the number of free rows that the client requires.
protected java.lang.Object[][] ResizeArray(java.lang.Object[][] arrData, int iNewRowcount, int iColcount)
arrData
- is the array we're growing or shrinkingiNewRowcount
- is the number of rows desired
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |