![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: Sequence.h 00008 // Contents: Sequence class 00009 // Author: Anthony J H Simons 00010 // Revised: 31 October 2005 00011 00012 // This software is distributed free in the hope that others will 00013 // find it useful. However, it comes WITHOUT ANY WARRANTY. No 00014 // liability can be accepted for software failure, merchantability 00015 // or fitness for a particular purpose. You can redistribute this 00016 // software in its original form, or in a modified form, provided 00017 // that this disclaimer is retained in the file banner. 00018 00019 #ifndef SCL_SEQUENCE 00020 #define SCL_SEQUENCE 00021 00022 #include "Collection.h" // Include the superclass type 00023 #include "SequenceID.h" // Include the pointer type 00024 00037 00038 class Sequence : public Collection { 00039 protected: 00040 Sequence(const Sequence&); 00041 public: 00042 Sequence(); 00043 virtual ~Sequence(); 00044 virtual Natural hash() const; 00045 virtual Order compare(ObjectID) const; 00046 Order compare(SequenceID) const; 00047 virtual ObjectID item(Integer) const; 00048 virtual Void add(ObjectID); 00049 virtual ObjectID first() const; 00050 virtual ObjectID last() const; 00051 virtual Void addFirst(ObjectID); 00052 virtual Void addLast(ObjectID); 00053 virtual Void removeFirst(); 00054 virtual Void removeLast(); 00055 virtual ObjectID getAt(Integer) const; 00056 virtual Void putAt(Integer, ObjectID); 00057 virtual Void addAt(Integer, ObjectID); 00058 virtual Void removeAt(Integer); 00059 }; 00060 00062 00065 inline SequenceID::SequenceID() {} 00066 00068 inline SequenceID::~SequenceID() {} 00069 00073 inline SequenceID::SequenceID(const Null* null) : 00074 CollectionID(null) {} 00075 00079 inline SequenceID::SequenceID(const Sequence* sequence) : 00080 CollectionID(sequence) {} 00081 00085 inline SequenceID::SequenceID(const SequenceID& pointer) : 00086 CollectionID(pointer) {} 00087 00091 inline SequenceID& SequenceID::operator=(const Sequence* sequence) { 00092 assign(sequence); 00093 return *this; 00094 } 00095 00100 inline SequenceID& SequenceID::operator=(const SequenceID& pointer) { 00101 assign(pointer); 00102 return *this; 00103 } 00104 00105 00106 #endif 00107