18#ifndef __LIBSTD_SEQUENCE_H
19#define __LIBSTD_SEQUENCE_H
77 for (
Size i = 0; i < s; i++)
112 for (
Size i = 0; i < s; i++)
123 virtual const T *
get(
Size position)
const = 0;
134 virtual const T &
at(
Size position)
const = 0;
143 for (
Size i = 0; i < sz; i++)
160 return s.
size() - sz;
163 if (s.
count() != cnt)
164 return s.
count() - cnt;
167 for (
Size i = 0; i < cnt; i++)
169 if (
at(i) != s.
at(i))
Objects which can be compared to each other.
Containers provide access to stored items.
virtual Size count() const =0
Returns the number of items inside the Container.
virtual Size size() const =0
Returns the maximum size of this Container.
Sequences are containers that provide indexed based storage of items.
virtual int insert(const T &item)
Adds the given item to the Sequence, if possible.
virtual bool removeAt(Size position)
Removes the item at the given position.
virtual const T * get(Size position) const =0
Returns the item at the given position.
virtual void clear()
Removes all items from the Sequence.
virtual int compareTo(const Sequence< T > &s) const
Compare this Sequence to another Sequence.
virtual void fill(T value)
Fill the Sequence with the given value.
virtual bool equals(const Sequence< T > &s) const
Test if this Sequence is equal to an other Sequence.
virtual const T & at(Size position) const =0
Returns a reference to the item at the given position.
virtual bool contains(const T value) const
Check if the given item is stored in this Sequence.
const T & operator[](int i) const
Returns the item at the given position in the Sequence.
virtual int remove(T value)
Remove all items with the given value.
virtual bool insert(Size position, const T &item)
Inserts the given item at the given position.
unsigned int Size
Any sane size indicator cannot go negative.