Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Class «library::CircularList<Type,Alloc>»

Circular doubly linked list.

public:


                                          CircularList();

                                          CircularList(const Type illegal);

 virtual                                 ~CircularList();

 virtual bool                             add(int32 index, Type element);

 virtual bool                             add(Type element);

 virtual bool                             add(Type element);

 virtual library::Buffer<Type,0,Alloc>*   array() const;

 virtual void                             clear();

 virtual Type                             get(int32 index) const;

 virtual Type                             getFirst() const;

 virtual Type                             getIllegal() const;

 virtual int32                            getIndexOf(const Type& element) const;

 virtual Type                             getLast() const;

 virtual int32                            getLength() const;

 virtual api::ListIterator<Type>*         getListIterator(int32 index);

 virtual Type                             getNext();

 virtual bool                             hasNext() const;

 virtual bool                             isConstructed() const;

 virtual bool                             isEmpty() const;

 virtual bool                             isIllegal(const Type& value) const;

 virtual bool                             isIndex(int32 index) const;

 static bool                              isObject(const Type* obj);

 Object&                                  operator =(const Object& obj);

 void                                     operator delete(void* ptr);

 void*                                    operator new(size_t size);

 void*                                    operator new(size_t size, void* ptr);

 virtual Type                             peek() const;

 virtual bool                             remove();

 virtual bool                             remove();

 virtual bool                             remove(int32 index);

 virtual bool                             removeElement(const Type& element);

 virtual bool                             removeFirst();

 virtual bool                             removeLast();

 virtual void                             setIllegal(Type value);

public: CircularList();

Constructor.

public: CircularList(const Type illegal);

Constructor.

Parameters:
illegal — illegal element.

public: virtual ~CircularList();

Destructor.

public: virtual bool add(int32 index, Type element);

Inserts new element to the specified position in this container.

Parameters:
index — position in this container.
element — inserting element.

Returns:
true if element is inserted.

public: virtual bool add(Type element);

Inserts new element to this container.

Parameters:
element — inserting element.

Returns:
true if element is added.

public: virtual bool add(Type element);

Inserts new element to the end of this container.

Parameters:
element — inserting element.

Returns:
true if element is added.

public: virtual library::Buffer<Type,0,Alloc>* array() const;

Destructor.

public: virtual void clear();

Removes all elements from this container.

public: virtual Type get(int32 index) const;

Returns an element from this container by index.

Parameters:
index — position in this container.

Returns:
indexed element of this container.

public: virtual Type getFirst() const;

Returns the first element in this container.

Returns:
the first element in this container.

public: virtual Type getIllegal() const;

Returns illegal element which will be returned as error value.

Returns:
illegal element.

public: virtual int32 getIndexOf(const Type& element) const;

Returns the index of the first occurrence of the specified element in this container.

Parameters:
element — reference to the element.

Returns:
index or -1 if this container does not contain the element.

public: virtual Type getLast() const;

Returns the last element in this container.

Returns:
the last element in this container.

public: virtual int32 getLength() const;

Returns a number of elements in this container.

Returns:
number of elements.

public: virtual api::ListIterator<Type>* getListIterator(int32 index);

Returns a list iterator of this container elements.

You have to call delete operator for returned iterator after it is used. Given index must not be out of bounds (index < 0 || index > length()).

Parameters:
index — start position in this container.

Returns:
pointer to new list iterator.

public: virtual Type getNext();

Returns next element and advances the cursor position.

Returns:
reference to element.

public: virtual bool hasNext() const;

Tests if this iteration may return a next element.

Returns:
true if next element is had.

public: virtual bool isConstructed() const;

Tests if this object has been constructed.

public: virtual bool isEmpty() const;

Tests if this collection has elements.

Returns:
true if this collection does not contain any elements.

public: virtual bool isIllegal(const Type& value) const;

Tests if given value is an illegal.

Parameters:
value — testing value.

Returns:
true if value is an illegal.

public: virtual bool isIndex(int32 index) const;

Tests if given index is available.

Parameters:
index — checking position in this container.

Returns:
true if index is present.

public: static bool isObject(const Type* obj);

Tests if given object has been constructed object.

public: Object& operator =(const Object& obj);

Assignment operator.

Parameters:
obj — reference to source object.

Returns:
reference to this object.

public: void operator delete(void* ptr);

Operator delete.

Parameters:
ptr — address of allocated memory block or a null pointer.

public: void* operator new(size_t size);

Operator new.

Parameters:
size — number of bytes to allocate.

Returns:
allocated memory address or a null pointer.

public: void* operator new(size_t size, void* ptr);

Operator new.

Parameters:
size — unused.
ptr — pointer to reserved memory area

Returns:
given pointer.

public: virtual Type peek() const;

Examines the head element of this container.

Returns:
the head element.

public: virtual bool remove();

Removes the head element of this container.

Returns:
true if an element is removed successfully.

public: virtual bool remove();

Removes the last element returned by this iterator.

Returns:
true if an element is removed successfully.

public: virtual bool remove(int32 index);

Removes the element at the specified position in this container.

Parameters:
index — position in this container.

Returns:
true if an element is removed successfully.

public: virtual bool removeElement(const Type& element);

Removes the first occurrence of the specified element from this container.

Parameters:
element — reference to element.

Returns:
true if an element is removed successfully.

public: virtual bool removeFirst();

Removes the first element from this container.

Returns:
true if an element is removed successfully.

public: virtual bool removeLast();

Removes the last element from this container.

Returns:
true if an element is removed successfully.

public: virtual void setIllegal(Type value);

Sets illegal element which will be returned as error value.

Parameters:
value — illegal value.

Back to class list