Located in compilation unit of org.
CollectionImpl#item must traverse down the tree and decrement the
index until it matches an element who's index is zero. Since integers are
passed by value, this class servers to pass the index into each recursion
by reference. It encompasses all the operations that need be performed on
the index, although direct access is possible.
CollectionImpl#item
| Modifier and Type | Field and Description |
|---|---|
| private int | _index
Holds the actual value that is passed by reference using this class. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv int | |
| pack-priv boolean |
| _index | back to summary |
|---|---|
| private int _index Holds the actual value that is passed by reference using this class. | |
| CollectionIndex | back to summary |
|---|---|
| pack-priv CollectionIndex(int index) Constructs a new index with the specified initial value. The index will then be decremeneted until it reaches zero.
| |
| decrement | back to summary |
|---|---|
| pack-priv void decrement() Decrements the index by one. | |
| getIndex | back to summary |
|---|---|
| pack-priv int getIndex() Returns the current index.
| |
| isZero | back to summary |
|---|---|
| pack-priv boolean isZero() Returns true if index is zero (or negative).
| |