#include <jem/util/ObjectList.h>
jem::util::ObjectList::ObjectList |
( |
| ) |
|
virtual jem::util::ObjectList::~ObjectList |
( |
| ) |
|
|
protectedvirtual |
virtual Ref<Object> jem::util::ObjectList::clone |
( |
| ) |
const |
|
virtual |
virtual Ref<SeqEnum> jem::util::ObjectList::getSeqEnum |
( |
| ) |
const |
|
virtual |
virtual void jem::util::ObjectList::insert |
( |
idx_t |
idx, |
|
|
const Ref< Object > & |
obj |
|
) |
| |
|
virtual |
virtual void jem::util::ObjectList::insertSpace |
( |
idx_t |
idx, |
|
|
idx_t |
count |
|
) |
| |
|
virtual |
virtual void jem::util::ObjectList::erase |
( |
idx_t |
idx | ) |
|
|
virtual |
virtual void jem::util::ObjectList::eraseRange |
( |
idx_t |
from, |
|
|
idx_t |
to |
|
) |
| |
|
virtual |
virtual Ref<Object> jem::util::ObjectList::get |
( |
idx_t |
idx | ) |
const |
|
virtual |
virtual void jem::util::ObjectList::set |
( |
idx_t |
idx, |
|
|
const Ref< Object > & |
obj |
|
) |
| |
|
virtual |
virtual bool jem::util::ObjectList::add |
( |
const Ref< Object > & |
obj | ) |
|
|
virtual |
Requests that the object obj is added to this collection. This function returns true
if the object has been added, and false
otherwise. An implementation of this function does not have to add the object if it is already present in this collection and if all objects in this collection should be unique.
This function may not be called if an enumerator points to this collection.
- Parameters
-
obj | - the object to be added. |
- Returns
true
if the object has been added to this collection, and false
otherwise.
Reimplemented from jem::util::ObjectSequence.
virtual Ref<Object> jem::util::ObjectList::front |
( |
| ) |
const |
|
virtual |
virtual Ref<Object> jem::util::ObjectList::back |
( |
| ) |
const |
|
virtual |
virtual void jem::util::ObjectList::pushBack |
( |
const Ref< Object > & |
obj | ) |
|
|
virtual |
virtual void jem::util::ObjectList::pushFront |
( |
const Ref< Object > & |
obj | ) |
|
|
virtual |
virtual void jem::util::ObjectList::popBack |
( |
| ) |
|
|
virtual |
virtual void jem::util::ObjectList::popFront |
( |
| ) |
|
|
virtual |
virtual void jem::util::ObjectList::clear |
( |
| ) |
|
|
virtual |
Deletes all objects from this collection.
This function may not be called if an enumerator points to this collection.
- Postcondition
this->size() == 0
Reimplemented from jem::util::ObjectSequence.
virtual void jem::util::ObjectList::reserve |
( |
idx_t |
count | ) |
|
|
virtual |
virtual void jem::util::ObjectList::trimToSize |
( |
| ) |
|
|
virtual |
Notifies this collection that it should deallocate non-used memory. Call this function after you have added all objects to this collection.
For efficiency reasons, an ObjectCollection
may allocate extra memory each time that an object is added and no more free space is left in its internal data structures. This means that the ObjectCollection
may use more memory than is actually needed to store all objects. This member function informs the ObjectCollection
that no more new objects will be added and that it should shrink its data structures as much as possible.
This function may not be called if an enumerator points to this collection.
- See also
reserve()
, capacity()
Reimplemented from jem::util::ObjectCollection.
virtual idx_t jem::util::ObjectList::capacity |
( |
| ) |
const |
|
virtual |
Returns the number of objects that this collection can contain without having to expand its internal data structures. This number is called the capacity of this collection.
The implementation of this function provided by the ObjectCollection
class simply returns size()
.
- Returns
- The capacity of this collection.
Reimplemented from jem::util::ObjectCollection.
virtual idx_t jem::util::ObjectList::size |
( |
| ) |
const |
|
virtual |
Returns the number of objects in this collection.
- Returns
- The number of objects in this collection.
Implements jem::util::ObjectCollection.