| Modifier and Type | Method and Description |
|---|---|
| public Iterable | Returns: iterable whose first element is this position, iteration proceeds toward index 0Iterable for this position and all previous positions in decreasing index order |
| public void | detachListener()
Tells listener to remove itself from parent NOTE: used as optimization in iterators which are guaranteed not to have any other references to their position element. |
| public boolean | |
| public Iterable | Returns: iterable whose first element is this position, iteration proceeds toward index list.size()iterable for this position and all following positions in increasing index order |
| public @NotNull PositionAnchor | |
| public int | Returns: absolute index in list, even when this position does not refer to a valid element it will always be [-1, list.size()] if it is referring to a valid element then the returned range will be [0, list.size()-1]FIX: allow getIndex(offset) to return -1 |
| public int | Returns: hashListeners should not change hashCode() or equals() from their default implementation where the instance is only equal to itself. |
| public boolean | |
| public boolean | Returns: true if getPreviousIndex() will return a value, false ifprevious() will throw an exception
|
| public boolean | |
| public boolean | |
| public boolean | Returns: true if this position represents a valid element in the list, ie. isValid() is true and index is at or before last element in list
|
| public P | Returns: previous valid position relative to this position, with the same position anchor as this position throwsIndexOutOfBoundsException if there is no elements before current positionGet next index position relative to current, returns next position if it exists even when this position is not valid |
| public Iterable | Returns: iterable whose first element is one after this position, iteration proceeds toward index list.size()Iterator for all following positions, excluding this position in increasing index order |
| public int | |
| public P | Returns: next position or nullReturn valid next position, with the same position anchor as this position, or null if does not exist. |
| public P | Returns: previous valid position relative to this position, with the same position anchor as this position throwsIndexOutOfBoundsException if there is no elements before current positionGet previous index position relative to current, returns previous index if it exists even when this position is not valid |
| public Iterable | Returns: iterable whose first element is previous to this position, iteration proceeds toward index 0iterable for all previous positions, excluding this position in decreasing index order |
| public int | Returns: the index of the element that would be returned by a subsequent call toprevious, or -1 if the list
iterator is at the beginning of the listReturns the index of the element that would be returned by a
subsequent call to |
| public P | Returns: previous position or nullReturn valid previous position, with the same position anchor as this position, or null if does not exist. |
| public T | Returns: removed current element, throws IllegalStateException if current index is not valid or after last element of list
|
| public void | setDetached()
Tells the listener it has been detached by its parent list NOTE: used as optimization in position list frames to detach any positions which have not been unframed() |
| public void | |
| public P | Returns: new position with requested or this if there is no anchor changedesired anchor position anchor)Get a new position with requested anchor from this position CURRENT - position represents the element and if deleted will be invalidated, if inserting at or before index then will advance to keep position of element NEXT - position represents the next element PREVIOUS - position represents the previous element |
| backwards | back to summary |
|---|---|
| public Iterable Iterable for this position and all previous positions in decreasing index order
| |
| detachListener | back to summary |
|---|---|
| public void detachListener() Tells listener to remove itself from parent NOTE: used as optimization in iterators which are guaranteed not to have any other references to their position element.
Do not otherwise use this because this position will stop having the list modification updates and will throw | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Listeners should not change hashCode() or equals() from their default implementation where the instance is only equal to itself. Otherwise, a new instance can remove an old one from the weak hash map used to hold listener instances.
| |
| forwards | back to summary |
|---|---|
| public Iterable iterable for this position and all following positions in increasing index order
| |
| getAnchor | back to summary |
|---|---|
| public @NotNull PositionAnchor getAnchor() Position Anchor for this position
| |
| getIndex | back to summary |
|---|---|
| public int getIndex() FIX: allow getIndex(offset) to return -1
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Listeners should not change hashCode() or equals() from their default implementation where the instance is only equal to itself. Otherwise, a new instance can remove an old one from the weak hash map used to hold listener instances.
| |
| hasNext | back to summary |
|---|---|
public boolean hasNext()
| |
| hasPrevious | back to summary |
|---|---|
public boolean hasPrevious()
| |
| isDetached | back to summary |
|---|---|
| public boolean isDetached() | |
| isValid | back to summary |
|---|---|
public boolean isValid()
| |
| isValidElement | back to summary |
|---|---|
public boolean isValidElement()
| |
| next | back to summary |
|---|---|
| public P next() Get next index position relative to current, returns next position if it exists even when this position is not valid
| |
| nextForwards | back to summary |
|---|---|
| public Iterable Iterator for all following positions, excluding this position in increasing index order
| |
| nextIndex | back to summary |
|---|---|
| public int nextIndex() Returns the index of the element that would be returned by a
subsequent call to
| |
| nextOrNull | back to summary |
|---|---|
| public P nextOrNull() Return valid next position, with the same position anchor as this position, or null if does not exist. Does not throw exceptions
| |
| previous | back to summary |
|---|---|
| public P previous() Get previous index position relative to current, returns previous index if it exists even when this position is not valid
| |
| previousBackwards | back to summary |
|---|---|
| public Iterable iterable for all previous positions, excluding this position in decreasing index order
| |
| previousIndex | back to summary |
|---|---|
| public int previousIndex() Returns the index of the element that would be returned by a
subsequent call to
| |
| previousOrNull | back to summary |
|---|---|
| public P previousOrNull() Return valid previous position, with the same position anchor as this position, or null if does not exist. Does not throw exceptions
| |
| remove | back to summary |
|---|---|
public T remove()
| |
| setDetached | back to summary |
|---|---|
| public void setDetached() Tells the listener it has been detached by its parent list NOTE: used as optimization in position list frames to detach any positions which have not been unframed() | |
| unframed | back to summary |
|---|---|
| public void unframed() Mark this position as used outside the iteration frame in which it was created. It allows positions to not be detached when the frame is closed. | |
| withAnchor | back to summary |
|---|---|
| public P withAnchor(@NotNull PositionAnchor anchor) Get a new position with requested anchor from this position CURRENT - position represents the element and if deleted will be invalidated, if inserting at or before index then will advance to keep position of element NEXT - position represents the next element PREVIOUS - position represents the previous element
| |