/** * @file collection.hpp * @brief J Library Collection ヘッダファイル。 * @copyright 2001 - 2024 Nomura Kei * @depends * j/lang/iterable.hpp */ #ifndef J_UTIL_COLLECTION_HPP #define J_UTIL_COLLECTION_HPP #include <j/lang/iterable.hpp> namespace j { namespace util { template <typename T> class Collection : public j::lang::Iterable<T> { public: virtual ~Collection() = default; virtual int size() const = 0; virtual bool isEmpty() const = 0; virtual bool contains(const T &t) const = 0; virtual bool add(const T &t) = 0; virtual void clear() = 0; virtual bool remove(const T &t) = 0; }; } // namespace util } // namespace j #endif // J_UTIL_COLLECTION_HPP