xtd 0.2.0
xtd::collections::generic::iset< type_t > Class Template Referenceabstract
Inheritance diagram for xtd::collections::generic::iset< type_t >:

Definition

template<class type_t>
class xtd::collections::generic::iset< type_t >

Provides the base interface for the abstraction of sets.

Definition
template<class type_t>
class iset : public xtd::collections::generic::icollection<type_t>
Provides the base interface for the abstraction of sets.
Definition iset.hpp:33
Header
#include <xtd/collections/generic/iset>
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
This interface provides methods for implementing sets, which are collections that have unique elements and specific operations. The xtd::collections::generic::hash_set <type_t> and xtd::collections::generic::sorted_set <type_t> collections implement this interface.

Public Aliases

using iterator
 Represents the iterator of xtd::collections::generic::ienumerable value type.
 
using const_iterator
 Represents the const iterator of xtd::collections::generic::ienumerable value type.
 

Public Methods

virtual bool add (const type_t &item) noexcept=0
 Adds an element to the current set and returns a value to indicate if the element was successfully added.
 
virtual void except_with (const xtd::collections::generic::ienumerable< type_t > &other) noexcept=0
 Removes all elements in the specified collection from the current set.
 
virtual void intersec_with (const xtd::collections::generic::ienumerable< type_t > &other) noexcept=0
 Modifies the current set so that it contains only elements that are also in a specified collection.
 
virtual bool is_proper_subset_of (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether the current set is a proper (strict) superset of a specified collection.
 
virtual bool is_proper_superset_of (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether the current set is a proper (strict) superset of a specified collection.
 
virtual bool is_subset_of (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether a set is a subset of a specified collection.
 
virtual bool is_superset_of (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether a set is a superset of a specified collection.
 
virtual bool overlaps (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether the current set overlaps with the specified collection.
 
virtual bool set_equals (const xtd::collections::generic::ienumerable< type_t > &other) const noexcept=0
 Determines whether the current set and the specified collection contain the same elements.
 
virtual void symetric_excep_with (const xtd::collections::generic::ienumerable< type_t > &other) noexcept=0
 Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.
 
virtual void union_with (const xtd::collections::generic::ienumerable< type_t > &other) noexcept=0
 Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.
 

Member Typedef Documentation

◆ iterator

template<class type_t>
using xtd::collections::generic::iset< type_t >::iterator

Represents the iterator of xtd::collections::generic::ienumerable value type.

◆ const_iterator

template<class type_t>
using xtd::collections::generic::iset< type_t >::const_iterator

Represents the const iterator of xtd::collections::generic::ienumerable value type.

Member Function Documentation

◆ add()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::add ( const type_t & item)
pure virtualnoexcept

Adds an element to the current set and returns a value to indicate if the element was successfully added.

Parameters
itemThe element to add to the set.
Returns
true if the element is added to the set; false if the element is already in the set.

◆ except_with()

template<class type_t>
virtual void xtd::collections::generic::iset< type_t >::except_with ( const xtd::collections::generic::ienumerable< type_t > & other)
pure virtualnoexcept

Removes all elements in the specified collection from the current set.

Parameters
otherThe collection of items to remove from the set.
Remarks
This method is an O(n) operation, where n is the number of elements in the other parameter.

◆ intersec_with()

template<class type_t>
virtual void xtd::collections::generic::iset< type_t >::intersec_with ( const xtd::collections::generic::ienumerable< type_t > & other)
pure virtualnoexcept

Modifies the current set so that it contains only elements that are also in a specified collection.

Parameters
otherThe collection to compare to the current set.
Remarks
This method ignores any duplicate elements in other.

◆ is_proper_subset_of()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::is_proper_subset_of ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether the current set is a proper (strict) superset of a specified collection.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set is a proper superset of other; otherwise, false.

◆ is_proper_superset_of()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::is_proper_superset_of ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether the current set is a proper (strict) superset of a specified collection.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set is a proper superset of other; otherwise, false.

◆ is_subset_of()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::is_subset_of ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether a set is a subset of a specified collection.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set is a subset of other; otherwise, false.

◆ is_superset_of()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::is_superset_of ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether a set is a superset of a specified collection.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set is a superset of other; otherwise, false.

◆ overlaps()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::overlaps ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether the current set overlaps with the specified collection.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set and other share at least one common element; otherwise, false.

◆ set_equals()

template<class type_t>
virtual bool xtd::collections::generic::iset< type_t >::set_equals ( const xtd::collections::generic::ienumerable< type_t > & other) const
pure virtualnoexcept

Determines whether the current set and the specified collection contain the same elements.

Parameters
otherThe collection to compare to the current set.
Returns
true if the current set is equal to other; otherwise, false.

◆ symetric_excep_with()

template<class type_t>
virtual void xtd::collections::generic::iset< type_t >::symetric_excep_with ( const xtd::collections::generic::ienumerable< type_t > & other)
pure virtualnoexcept

Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.

Parameters
otherThe collection to compare to the current set.
Remarks
Any duplicate elements in other are ignored.

◆ union_with()

template<class type_t>
virtual void xtd::collections::generic::iset< type_t >::union_with ( const xtd::collections::generic::ienumerable< type_t > & other)
pure virtualnoexcept

Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.

Parameters
otherThe collection to compare to the current set.
Remarks
Any duplicate elements in other are ignored.

The documentation for this class was generated from the following file:
  • xtd.core/include/xtd/collections/generic/iset.hpp