23 #include <QLinkedList> 24 #include <QMutableLinkedListIterator> 31 :
public QLinkedList< QPair<IDX, DATA> >
35 typedef QPair<IDX,DATA>
Pair;
40 :QLinkedList< Pair >()
51 return QLinkedList<Pair>::isEmpty();
57 foreach(
const Pair &p, *
this) {
58 if (p.first == index) {
70 if (!QLinkedList<Pair>::isEmpty()) {
71 QMutableLinkedListIterator<Pair> it(*
this);
72 while (it.hasNext()) {
74 if (p.first == index) {
75 if (p.first != QLinkedList<Pair>::first().first) {
79 insert(pair.first, pair.second);
85 return QLinkedList<Pair>::first().second;
99 foreach(
const Pair &p, *
this) {
100 if (p.first == index)
110 void remove(
const IDX index)
112 if (!QLinkedList<Pair>::isEmpty()) {
113 QMutableLinkedListIterator<Pair> it(*
this);
114 while (it.hasNext()) {
116 if (p.first == index) {
129 void insert(
const IDX index, DATA &value)
131 QLinkedList<Pair>::prepend(
Pair(index, value));
138 foreach(
const Pair &p, *
this) {
148 foreach(
const Pair &p, *
this) {
const DATA & operator[](const IDX index) const
bool contains(const IDX index) const
QList< IDX > keys() const
QList< DATA > values() const
void insert(const IDX index, DATA &value)