| Modifier and Type | Field and Description |
|---|---|
| private final IntList | labelToIndex
Sparse array indexed by label to FixedSizeList index;
|
| Access | Constructor and Description |
|---|---|
| public | |
| public | LabeledList(LabeledList
instance to copy old)Constructs a new instance that is a copy of the old instance. |
| Modifier and Type | Method and Description |
|---|---|
| private void | addLabelIndex(int
new label label, int index of block. index)Adds a label and index to the label-to-index mapping. |
| public final int[] | Returns: non-null; ordered array of labelsGets an array containing all of the labels used in this instance, in order. |
| public final int | Returns: >= 0; the maximum labelGets the maximum label (exclusive) of any block added to this instance. |
| public final int | Returns: >= -1; the index of the so-labelled item, or -1
if none is found>= 0; the label to look forGets the index of the first item in the list with the given label, if any. |
| private void | |
| private void | |
| protected void | set(int
>= 0, < size(); which elementnull-ok; the value to storeSets the element at the given index. |
| public void | shrinkToFit()
Overrides org. null) elements, leaving the remaining elements in
their original order.
|
| labelToIndex | back to summary |
|---|---|
| private final IntList labelToIndex Sparse array indexed by label to FixedSizeList index;
| |
| LabeledList | back to summary |
|---|---|
| public LabeledList(int size) | |
| LabeledList | back to summary |
|---|---|
| public LabeledList(LabeledList old) Constructs a new instance that is a copy of the old instance.
| |
| addLabelIndex | back to summary |
|---|---|
| private void addLabelIndex(int label, int index) Adds a label and index to the label-to-index mapping.
| |
| getLabelsInOrder | back to summary |
|---|---|
| public final int[] getLabelsInOrder() Gets an array containing all of the labels used in this instance, in order. The returned array is freshly-allocated and so may be modified safely by the caller without impacting this instance.
| |
| getMaxLabel | back to summary |
|---|---|
| public final int getMaxLabel() Gets the maximum label (exclusive) of any block added to this instance.
| |
| indexOfLabel | back to summary |
|---|---|
| public final int indexOfLabel(int label) Gets the index of the first item in the list with the given label, if any.
| |
| rebuildLabelToIndex | back to summary |
|---|---|
| private void rebuildLabelToIndex() Rebuilds the label-to-index mapping after a Note This assumes that the labels that are in the list are the same, although the indicies may have changed. | |
| removeLabel | back to summary |
|---|---|
| private void removeLabel(int oldLabel) Removes a label from the label-to-index mapping.
| |
| set | back to summary |
|---|---|
| protected void set(int n, LabeledItem item) Sets the element at the given index.
| |
| shrinkToFit | back to summary |
|---|---|
| public void shrinkToFit() Overrides org. Doc from org. Shrinks this instance to fit, by removing any unset
(
| |