#include <orderedarraylist.h>
Public Member Functions | |
OrderedArrayList () | |
OrderedArrayList (int initialCapacity, int additionalCapacity) | |
OrderedArrayList (const OrderedArrayList &orig) | |
OrderedArrayList (const OrderedArrayList &orig, bool deepCopy) | |
virtual | ~OrderedArrayList () |
virtual ostream & | renderState (ostream &os) const |
Write the state of an Object for debugging and demonstration. | |
virtual const Info * | typeInfo () const |
Return the instance of Object::Info that describes the class of this object. | |
virtual Object * | clone (bool deepCopy=false) const |
A polymorphic copy constructor. | |
Static Public Attributes | |
static const Info *const | TYPE_INFO |
Protected Member Functions | |
virtual void | append_impl (Entity *entity) |
Called by a template method. | |
virtual void | insertBefore_impl (Entity *entity) |
Called by a template method. | |
virtual bool | add_impl (Entity *entity) |
Called by a template method. |
container::OrderedArrayList::OrderedArrayList | ( | ) |
container::OrderedArrayList::OrderedArrayList | ( | int | initialCapacity, | |
int | additionalCapacity = DEFAULT_ADDITIONAL_CAPACITY | |||
) |
container::OrderedArrayList::OrderedArrayList | ( | const OrderedArrayList & | orig | ) |
container::OrderedArrayList::OrderedArrayList | ( | const OrderedArrayList & | orig, | |
bool | deepCopy | |||
) |
bool container::OrderedArrayList::add_impl | ( | Entity * | entity | ) | [protected, virtual] |
Called by a template method.
Implements container::List.
00083 { 00084 append_impl(entity); 00085 return true; 00086 }
void container::OrderedArrayList::append_impl | ( | Entity * | entity | ) | [protected, virtual] |
Called by a template method.
Implements container::OrderedList.
00069 { 00070 const int targetIndex = getCount(); 00071 openGap(targetIndex); 00072 array[targetIndex] = entity; 00073 }
Object * container::OrderedArrayList::clone | ( | bool | deepCopy = false |
) | const [virtual] |
A polymorphic copy constructor.
Implements container::ArrayList.
00098 { 00099 return new OrderedArrayList(*this, deepCopy); 00100 }
void container::OrderedArrayList::insertBefore_impl | ( | Entity * | entity | ) | [protected, virtual] |
Called by a template method.
Implements container::OrderedList.
00075 { 00076 const int targetIndex = current; 00077 openGap(targetIndex); 00078 array[targetIndex] = entity; 00079 }
ostream & container::OrderedArrayList::renderState | ( | ostream & | os | ) | const [virtual] |
Write the state of an Object for debugging and demonstration.
This method must not change the state of an Object; adding or removing debug statements should not change the behavior of a class. The implementation must be robust, e.g., NULL safe, etc. and work without an unrecoverable error for any state, excluding an Object's time of construction and destruction. It is not required for the implementation to be thread safe.
Reimplemented from container::ArrayList.
00090 { 00091 return this->ArrayList::renderState(os); 00092 }
const Object::Info * container::OrderedArrayList::typeInfo | ( | ) | const [virtual] |
Return the instance of Object::Info that describes the class of this object.
Instantiation of Object::Info is controlled by the protected method Object::typeInfoFactory(const string&). Each sub-class of Object should create one and only one instance of Object::Info.
Reimplemented from container::ArrayList.
00094 { 00095 return TYPE_INFO; 00096 }
const Object::Info *const container::OrderedArrayList::TYPE_INFO [static] |