JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JLinkedListIterator< T > Class Template Reference

#include <JLinkedListIterator.h>

Inheritance diagram for JLinkedListIterator< T >:
[legend]

Public Member Functions

 JLinkedListIterator (const JLinkedList< T > &theLinkedList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JLinkedListIterator (JLinkedList< T > *theLinkedList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JLinkedListIterator (const JLinkedListIterator< T > &source)
 
 ~JLinkedListIterator () 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 RemovePrev (const JSize count=1) override
 
bool RemoveNext (const JSize count=1) override
 
bool Insert (const T &data) override
 
- 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
 
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)
 

Constructor & Destructor Documentation

◆ JLinkedListIterator() [1/3]

template<class T >
JLinkedListIterator< T >::JLinkedListIterator ( const JLinkedList< T > &  theLinkedList,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

Efficient interation for JLinkedList objects.

◆ JLinkedListIterator() [2/3]

template<class T >
JLinkedListIterator< T >::JLinkedListIterator ( JLinkedList< T > *  theLinkedList,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

◆ JLinkedListIterator() [3/3]

template<class T >
JLinkedListIterator< T >::JLinkedListIterator ( const JLinkedListIterator< T > &  source)

◆ ~JLinkedListIterator()

template<class T >
JLinkedListIterator< T >::~JLinkedListIterator ( )
override

Member Function Documentation

◆ Insert()

template<class T >
bool JLinkedListIterator< T >::Insert ( const T &  data)
overridevirtual

Returns true if we have a non-const JLinkedList<T>*.

Implements JListIterator< T >.

◆ ListChanged()

template<class T >
void JLinkedListIterator< T >::ListChanged ( const JBroadcaster::Message message)
overrideprotectedvirtual

Respond to changes in itsLinkedList. In order to optimize, we would have to check if prev or next was invalid.

Reimplemented from JListIterator< T >.

◆ MoveTo()

template<class T >
void JLinkedListIterator< T >::MoveTo ( const JListT::Position  newPosition,
const JIndex  index 
)
overridevirtual

Reset the iterator position to one of: kJIteratorStartAtBeginning, kJIteratorStartAtEnd, kJIteratorStartBefore(index), or kJIteratorStartAfter(index)

Reimplemented from JListIterator< T >.

◆ Next()

template<class T >
bool JLinkedListIterator< T >::Next ( T *  item,
const JListT::Action  move = JListT::kMove 
)
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 >.

◆ Prev()

template<class T >
bool JLinkedListIterator< T >::Prev ( T *  item,
const JListT::Action  move = JListT::kMove 
)
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 >.

◆ RemoveNext()

template<class T >
bool JLinkedListIterator< T >::RemoveNext ( const JSize  count = 1)
overridevirtual

Returns true if we have a non-const JLinkedList<T>* and there is at least one next item.

Implements JListIterator< T >.

◆ RemovePrev()

template<class T >
bool JLinkedListIterator< T >::RemovePrev ( const JSize  count = 1)
overridevirtual

Returns true if we have a non-const JLinkedList<T>* and there is at least one previous item.

Implements JListIterator< T >.

◆ SetNext()

template<class T >
bool JLinkedListIterator< T >::SetNext ( const T &  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if we have a non-const JLinkedList<T>* and there is a next item.

Implements JListIterator< T >.

◆ SetPrev()

template<class T >
bool JLinkedListIterator< T >::SetPrev ( const T &  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if we have a non-const JLinkedList<T>* and there is a previous item.

Implements JListIterator< T >.

◆ SkipNext()

template<class T >
void JLinkedListIterator< T >::SkipNext ( const JSize  count = 1)
overridevirtual

Implements JListIterator< T >.

◆ SkipPrev()

template<class T >
void JLinkedListIterator< T >::SkipPrev ( const JSize  count = 1)
overridevirtual

Implements JListIterator< T >.


The documentation for this class was generated from the following files: