|
JX Application Framework
|
#include <JRunArrayIterator.h>
Public Member Functions | |
| JRunArrayIterator (const JRunArray< T > &theRunArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) | |
| JRunArrayIterator (JRunArray< T > *theRunArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) | |
| JRunArrayIterator (const JRunArrayIterator< T > &source) | |
| ~JRunArrayIterator () override | |
| bool | Prev (T *item, const JListT::Action move=JListT::kMove) override |
| bool | Next (T *item, const JListT::Action move=JListT::kMove) override |
| void | SkipPrev (const JSize count=1) override |
| void | SkipNext (const JSize count=1) override |
| void | MoveTo (const JListT::Position newPosition, const JIndex index) override |
| bool | SetPrev (const T &data, const JListT::Action move=JListT::kMove) override |
| bool | SetNext (const T &data, const JListT::Action move=JListT::kMove) override |
| bool | SetPrev (const T &data, const JSize count, const JListT::Action move=JListT::kMove) |
| bool | SetNext (const T &data, const JSize count, const JListT::Action move=JListT::kMove) |
| bool | RemovePrev (const JSize count=1) override |
| bool | RemoveNext (const JSize count=1) override |
| bool | Insert (const T &data) override |
| bool | Insert (const T &data, const JSize count) |
| bool | InsertSlice (const JRunArray< T > &source, const JIndexRange &range) |
| bool | AtFirstRun () const |
| bool | AtLastRun () const |
| bool | PrevRun () |
| bool | NextRun () |
| JIndex | GetRunStart () const |
| JIndex | GetRunEnd () const |
| JSize | GetRunLength () const |
| JSize | GetRemainingInRun () const |
| T | GetRunData () const |
Public Member Functions inherited from JListIterator< T > | |
| JListIterator (const JList< T > &theList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) | |
| JListIterator (JList< T > *theList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0) | |
| virtual | ~JListIterator () |
| const JList< T > * | GetList () const |
| bool | GetList (JList< T > **obj) const |
| bool | Prev (std::function< bool(const T &)> match, T *item) |
| bool | Next (std::function< bool(const T &)> match, T *item) |
| bool | AtBeginning () const |
| bool | AtEnd () const |
| JIndex | GetPrevItemIndex () const |
| JIndex | GetNextItemIndex () const |
| bool | GetPrevItemIndex (JIndex *i) const |
| bool | GetNextItemIndex (JIndex *i) const |
| T | operator* () const |
| JListIterator< T > & | operator++ () |
| bool | operator== (const JListIterator< T > &it) const |
Protected Member Functions | |
| void | ListChanged (const JBroadcaster::Message &message) override |
Protected Member Functions inherited from JListIterator< T > | |
| JListIterator (const JListIterator< T > &source) | |
| JCursorPosition | GetCursor () const |
| void | SetCursor (const JCursorPosition pos) |
| JRunArrayIterator< T >::JRunArrayIterator | ( | const JRunArray< T > & | theRunArray, |
| const JListT::Position | start = JListT::kStartAtBeginning, |
||
| const JIndex | index = 0 |
||
| ) |
Efficient interation for JRunArray objects.
+-----+-----+-----+*****+*****+-----+-----+
index | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+-----+-----+-----+*****+*****+-----+-----+
run 1 1 1 2 2 3 3 4
inRun 0 1 2 0 1 0 1 0
| JRunArrayIterator< T >::JRunArrayIterator | ( | JRunArray< T > * | theRunArray, |
| const JListT::Position | start = JListT::kStartAtBeginning, |
||
| const JIndex | index = 0 |
||
| ) |
| JRunArrayIterator< T >::JRunArrayIterator | ( | const JRunArrayIterator< T > & | source | ) |
|
override |
| bool JRunArrayIterator< T >::AtFirstRun | ( | ) | const |
| bool JRunArrayIterator< T >::AtLastRun | ( | ) | const |
| JSize JRunArrayIterator< T >::GetRemainingInRun | ( | ) | const |
| T JRunArrayIterator< T >::GetRunData | ( | ) | const |
| JIndex JRunArrayIterator< T >::GetRunEnd | ( | ) | const |
| JSize JRunArrayIterator< T >::GetRunLength | ( | ) | const |
| JIndex JRunArrayIterator< T >::GetRunStart | ( | ) | const |
|
overridevirtual |
Returns true if we have a non-const JRunArray<T>*.
Implements JListIterator< T >.
| bool JRunArrayIterator< T >::Insert | ( | const T & | data, |
| const JSize | count | ||
| ) |
| bool JRunArrayIterator< T >::InsertSlice | ( | const JRunArray< T > & | source, |
| const JIndexRange & | range | ||
| ) |
Returns true if we have a non-const JRunArray<T>*.
|
overrideprotectedvirtual |
Respond to changes in itsRunArray. We can't optimize anything because inserting and removing items can merge runs or split a run. We have to ask our JRunArray what happened.
Reimplemented from JListIterator< T >.
|
overridevirtual |
Reset the iterator position to one of: kJIteratorStartAtBeginning, kJIteratorStartAtEnd, IteratorStartBefore(index), or IteratorStartAfter(index)
Reimplemented from JListIterator< T >.
|
overridevirtual |
Return TRUE if there is a next item, fetching the next item in the list and decrementing the iterator position. Otherwise return FALSE without fetching or decrementing.
Implements JListIterator< T >.
| bool JRunArrayIterator< T >::NextRun | ( | ) |
If there is a next run, moves the iterator position to the start of that run and returns TRUE.
|
overridevirtual |
Return TRUE if there is a previous item, fetching the previous item in the list and decrementing the iterator position. Otherwise return FALSE without fetching or decrementing.
Implements JListIterator< T >.
| bool JRunArrayIterator< T >::PrevRun | ( | ) |
If there is a previous run, moves the iterator position to the start of that run and returns TRUE.
|
overridevirtual |
Returns true if we have a non-const JRunArray<T>* and there is a next item.
Implements JListIterator< T >.
|
overridevirtual |
Returns true if we have a non-const JRunArray<T>* and there is a previous item.
Implements JListIterator< T >.
|
overridevirtual |
Returns true if we have a non-const JRunArray<T>* and there is a next item.
Implements JListIterator< T >.
| bool JRunArrayIterator< T >::SetNext | ( | const T & | data, |
| const JSize | count, | ||
| const JListT::Action | move = JListT::kMove |
||
| ) |
Returns true if we have a non-const JRunArray<T>* and there are next items.
|
overridevirtual |
Returns true if we have a non-const JRunArray<T>* and there is a previous item.
Implements JListIterator< T >.
| bool JRunArrayIterator< T >::SetPrev | ( | const T & | data, |
| const JSize | count, | ||
| const JListT::Action | move = JListT::kMove |
||
| ) |
Returns true if we have a non-const JRunArray<T>* and there are previous items.
|
overridevirtual |
Implements JListIterator< T >.
|
overridevirtual |
Implements JListIterator< T >.