Represents a doubly linked list.
Public Aliases | |
| using | value_type |
| Represents the list value type. | |
| using | base_type |
| Represents the list base type. | |
| using | size_type |
| Represents the list size type (usually xtd::size). | |
| using | reference |
| Represents the reference of list value type. | |
| using | const_reference |
| Represents the const reference of list value type. | |
Public Constructors | |
| linked_list ()=default | |
| Initializes a new instance of the xtd::collections::generic::linked_list <type_t> class that is empty. | |
| linked_list (linked_list &&list)=default | |
| Move constructor with specified list. | |
| linked_list (const linked_list &list) | |
| Default copy constructor with specified list. | |
| linked_list (base_type &&list) | |
| Move constructor with specified base type list. | |
| linked_list (const base_type &list) | |
| Copy constructor with specified base type list. | |
| linked_list (const xtd::collections::generic::ienumerable< type_t > &collection) | |
| Initializes a new instance of the xtd::collections::generic::linked_list <type_t> class that contains elements copied from the specified xtd::collections::generic::ienumerable and has sufficient capacity to accommodate the number of elements copied. | |
| linked_list (std::initializer_list< type_t > items) | |
| Constructs the container with the contents of the specified initializer list, and allocator. | |
| template<std::input_iterator input_iterator_t> | |
| linked_list (input_iterator_t first, input_iterator_t last) | |
| Constructs the container with the contents of the range [first, last). | |
Public Properties | |
| auto | count () const noexcept -> size_type override |
| Gets the number of nodes actually contained in the xtd::collections::generic::linked_list <type_t>. | |
| auto | first () const noexcept -> xtd::optional< linked_list_node< type_t > > |
| Gets the first node of the xtd::collections::generic::linked_list <type_t>. | |
| auto | first () noexcept -> xtd::optional< linked_list_node< type_t > > |
| Gets the first node of the xtd::collections::generic::linked_list <type_t>. | |
| auto | items () const noexcept -> const base_type & |
| Returns the underlying base type items. | |
| auto | items () noexcept -> base_type & |
| Returns the underlying base type items. | |
| auto | last () const noexcept -> xtd::optional< linked_list_node< type_t > > |
| Gets the last node of the xtd::collections::generic::linked_list <type_t>. | |
| auto | last () noexcept -> xtd::optional< linked_list_node< type_t > > |
| Gets the last node of the xtd::collections::generic::linked_list <type_t>. | |
Public Methods | |
| auto | add_after (const linked_list_node< type_t > &node, const type_t &value) -> linked_list_node< type_t > |
| Adds a new node containing the specified value after the specified existing node in the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_after (const linked_list_node< type_t > &node, linked_list_node< type_t > &new_node) -> void |
| Adds the specified new node after the specified existing node in the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_before (const linked_list_node< type_t > &node, const type_t &value) -> linked_list_node< type_t > |
| Adds a new node containing the specified value before the specified existing node in the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_before (const linked_list_node< type_t > &node, linked_list_node< type_t > &new_node) -> void |
| Adds the specified new node before the specified existing node in the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_first (const type_t &value) -> linked_list_node< type_t > |
| Adds a new node containing the specified value at the start of the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_first (linked_list_node< type_t > &node) -> void |
| Adds the specified new node at the start of the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_last (const type_t &value) -> linked_list_node< type_t > |
| Adds a new node containing the specified value at the end of the xtd::collections::generic::linked_list <type_t>. | |
| auto | add_last (linked_list_node< type_t > &node) -> void |
| Adds the specified new node at the end of the xtd::collections::generic::linked_list <type_t>. | |
| auto | clear () -> void override |
| Removes all elements from the xtd::collections::generic::linked_list <type_t>. | |
| auto | contains (const type_t &value) const noexcept -> bool override |
| Determines whether an element is in the xtd::colllections::generic::linked_list <type_t>. | |
| auto | copy_to (xtd::array< type_t > &array, size_type array_index) const -> void override |
| Copies the entire xtd::colllections::generic::linked_list <type_t> to a compatible one-dimensional array, starting at the specified index of the target array. | |
| auto | find (const type_t value) const noexcept -> xtd::optional< linked_list_node< type_t > > |
| Finds the first node that contains the specified value. | |
| auto | find_last (const type_t value) const noexcept -> xtd::optional< linked_list_node< type_t > > |
| Finds the last node that contains the specified value. | |
| enumerator< value_type > | get_enumerator () const noexcept override |
| Returns an enumerator that iterates through the xtd::collections::generic::linked_list <type_t>. | |
| auto | remove (const type_t &item) noexcept -> bool override |
| Removes the first occurrence of a specific object from the xtd::collections::generic::linked_list <type_t>. | |
| auto | remove (linked_list_node< type_t > &node) -> void |
| Removes the specified node from the xtd::collections::generic::linked_list <type_t>. | |
| auto | remove_first () -> void |
| Removes the node at the start of the xtd::collections::generic::linked_list <type_t>. | |
| auto | remove_last () -> void |
| Removes the node at the end of the xtd::collections::generic::linked_list <type_t>. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a xtd::string that represents the current object. | |
Public Operators | |
| auto | operator= (const linked_list &other) -> linked_list &=default |
| Copy assignment operator. Replaces the contents with a copy of the contents of other. | |
| auto | operator= (linked_list &&other) noexcept -> linked_list & |
| Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards. | |
| auto | operator= (const std::initializer_list< type_t > &items) -> linked_list & |
| Replaces the contents with those identified by initializer list ilist. | |
| operator const base_type & () const noexcept | |
| Returns a reference to the underlying base type. | |
| operator base_type & () noexcept | |
| Returns a reference to the underlying base type. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. | |
| virtual xtd::size | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| template<class object_a_t, class object_b_t> | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal. | |
| template<class object_a_t, class object_b_t> | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance. | |
| using xtd::collections::generic::linked_list< type_t, allocator_t >::value_type |
Represents the list value type.
| using xtd::collections::generic::linked_list< type_t, allocator_t >::base_type |
Represents the list base type.
| using xtd::collections::generic::linked_list< type_t, allocator_t >::size_type |
Represents the list size type (usually xtd::size).
| using xtd::collections::generic::linked_list< type_t, allocator_t >::reference |
Represents the reference of list value type.
| using xtd::collections::generic::linked_list< type_t, allocator_t >::const_reference |
Represents the const reference of list value type.
|
default |
Initializes a new instance of the xtd::collections::generic::linked_list <type_t> class that is empty.
|
default |
Move constructor with specified list.
| list | The xtd::collections::generic::linked_list <type_t> which elements will be moved from. |
|
inline |
Default copy constructor with specified list.
| linked_list | The xtd::collections::generic::linked_list <type_t> which elements will be inserted from. |
|
inline |
Move constructor with specified base type list.
| list | The xtd::collections::generic::linked_list::base_type which elements will be moved from. |
|
inline |
Copy constructor with specified base type list.
| list | The xtd::collections::generic::linked_list::base_type which elements will be inserted from. |
|
inline |
Initializes a new instance of the xtd::collections::generic::linked_list <type_t> class that contains elements copied from the specified xtd::collections::generic::ienumerable and has sufficient capacity to accommodate the number of elements copied.
| collection | The xtd::collections::generic::ienumerable whose elements are copied to the new xtd::collections::generic::linked_list <type_t>. |
n) operation, where n is the number of elements in collection.
|
inline |
Constructs the container with the contents of the specified initializer list, and allocator.
| items | The initializer list to initialize the elements of the container with. |
|
inline |
Constructs the container with the contents of the range [first, last).
| first | The first iterator the range to copy the elements from. |
| last | The last iterator the range to copy the elements from. |
|
inlineoverridenoexcept |
Gets the number of nodes actually contained in the xtd::collections::generic::linked_list <type_t>.
|
inlinenoexcept |
Gets the first node of the xtd::collections::generic::linked_list <type_t>.
|
inlinenoexcept |
Gets the first node of the xtd::collections::generic::linked_list <type_t>.
|
inlinenoexcept |
Returns the underlying base type items.
|
inlinenoexcept |
Returns the underlying base type items.
|
inlinenoexcept |
Gets the last node of the xtd::collections::generic::linked_list <type_t>.
|
inlinenoexcept |
Gets the last node of the xtd::collections::generic::linked_list <type_t>.
|
inline |
Adds a new node containing the specified value after the specified existing node in the xtd::collections::generic::linked_list <type_t>.
| node | The xtd::collections::generic::linked_list_node <type_t> after which to insert value. |
| value | The value to add to the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds the specified new node after the specified existing node in the xtd::collections::generic::linked_list <type_t>.
| node | The xtd::collections::generic::linked_list_node <type_t> after which to insert new_node. |
| new_node | The new xtd::collections::generic::linked_list_node <type_t> to add to the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. -or- `new_node` belongs to another xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds a new node containing the specified value before the specified existing node in the xtd::collections::generic::linked_list <type_t>.
| node | The xtd::collections::generic::linked_list_node <type_t> before which to insert value. |
| value | The value to add to the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds the specified new node before the specified existing node in the xtd::collections::generic::linked_list <type_t>.
| node | The xtd::collections::generic::linked_list_node <type_t> before which to insert new_node. |
| new_node | The new xtd::collections::generic::linked_list_node <type_t> to add to the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. -or- `new_node` belongs to another xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds a new node containing the specified value at the start of the xtd::collections::generic::linked_list <type_t>.
| value | The value to add at the start of the start of the xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds the specified new node at the start of the xtd::collections::generic::linked_list <type_t>.
| node | The new xtd::collections::generic::linked_list_node <type_t> to add at the start of the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds a new node containing the specified value at the end of the xtd::collections::generic::linked_list <type_t>.
| value | The value to add at the start of the end of the xtd::collections::generic::linked_list <type_t>. |
|
inline |
Adds the specified new node at the end of the xtd::collections::generic::linked_list <type_t>.
| node | The new xtd::collections::generic::linked_list_node <type_t> to add at the end of the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | `node` is not in the current xtd::collections::generic::linked_list <type_t>. |
|
inlineoverride |
Removes all elements from the xtd::collections::generic::linked_list <type_t>.
|
inlineoverridenoexcept |
Determines whether an element is in the xtd::colllections::generic::linked_list <type_t>.
| value | The object to locate in the xtd::colllections::generic::linked_list <type_t>. The value can be null for reference types. |
true if item is found in the xtd::colllections::generic::linked_list <type_t>; otherwise, false.
|
inlineoverride |
Copies the entire xtd::colllections::generic::linked_list <type_t> to a compatible one-dimensional array, starting at the specified index of the target array.
| array | The one-dimensional Array that is the destination of the elements copied from xtd::colllections::generic::linked_list <type_t>. The Array must have zero-based indexing. |
| array_index | The zero-based index in array at which copying begins. |
| xtd::argument_out_of_range_exception | The number of elements in the source xtd::colllections::generic::linked_list <type_t> is greater than the available space from arrayIndex to the end of the destination array. |
|
inlinenoexcept |
Finds the first node that contains the specified value.
| value | The value to locate in the xtd::collections::generic::linked_list <type_t>. |
|
inlinenoexcept |
Finds the last node that contains the specified value.
| value | The value to locate in the xtd::collections::generic::linked_list <type_t>. |
|
inlineoverridenoexcept |
Returns an enumerator that iterates through the xtd::collections::generic::linked_list <type_t>.
|
inlineoverridenoexcept |
Removes the first occurrence of a specific object from the xtd::collections::generic::linked_list <type_t>.
| item | The object to remove from the xtd::collections::generic::linked_list <type_t>. |
true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the xtd::collections::generic::linked_list <type_t>. typ_t implements the xtd::iequatable <type_t> generic interface, the equality comparer is the xtd::iequatable::equals method of that interface; otherwise, the default equality comparer is xtd::object::equals.
|
inline |
Removes the specified node from the xtd::collections::generic::linked_list <type_t>.
| node | The xtd::collections::generic::linked_list_node <type_t> to remove from the xtd::collections::generic::linked_list <type_t>. |
| xtd::invalid_operation_exception | node is not in the current xtd::collections::generic::linked_list <type_t>. |
|
inline |
Removes the node at the start of the xtd::collections::generic::linked_list <type_t>.
| xtd::invalid_operation_exception | The xtd::collections::generic::linked_list <type_t> is empty. |
|
inline |
Removes the node at the end of the xtd::collections::generic::linked_list <type_t>.
| xtd::invalid_operation_exception | The xtd::collections::generic::linked_list <type_t> is empty. |
|
inlineoverridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
default |
Copy assignment operator. Replaces the contents with a copy of the contents of other.
| other | Another container to use as data source. |
|
inlinenoexcept |
Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards.
| other | Another base type container to use as data source. |
|
inline |
Replaces the contents with those identified by initializer list ilist.
| items | Initializer list to use as data source |
|
inlinenoexcept |
Returns a reference to the underlying base type.
|
inlinenoexcept |
Returns a reference to the underlying base type.