Interface XReplacingBag<E>

All Superinterfaces:
CapacityCarrying, Copyable, ExtendedCollection<E>, Iterable<E>, ReleasingCollection<E>, Sized, XGettingCollection<E>, XIterable<E>, XJoinable<E>, XReplacingCollection<E>
All Known Subinterfaces:
XBasicTable.Values<K,​V>, XChart.Values<K,​V>, XDecreasingList<E>, XIncreasingList<E>, XList<E>, XReference<E>, XSettingList<E>, XTable.Values<K,​V>
All Known Implementing Classes:
ArrayAccessor, ArrayCollector, BulkList, EqBulkList, EqHashTable.Values, FixedList, HashTable.Values, LimitList, LinkReference.Default, ListAccessor, LockedList, Single, Singleton, SubList, SubListAccessor, SubListProcessor, SynchList

public interface XReplacingBag<E>
extends XGettingCollection<E>, XReplacingCollection<E>
  • Method Details

    • replaceOne

      boolean replaceOne​(E element, E replacement)
      Replaces the first element that is equal to the given element with the replacement and then returns true.
      Parameters:
      element - to replace
      replacement - for the found element
      Returns:
      true if element is found, false if not
    • replace

      long replace​(E element, E replacement)
    • replaceAll

      long replaceAll​(XGettingCollection<? extends E> elements, E replacement)
    • replaceOne

      boolean replaceOne​(Predicate<? super E> predicate, E replacement)
    • replace

      long replace​(Predicate<? super E> predicate, E replacement)
    • substitute

      long substitute​(Predicate<? super E> predicate, Function<E,​E> mapper)
    • copy

      XReplacingBag<E> copy()
      Description copied from interface: XGettingCollection
      Creates a true copy of this collection which references the same elements as this collection does at the time the method is called. The elements themselves are NOT copied (no deep copying).
      The type of the returned set is the same as of this list if possible.
      Specified by:
      copy in interface Copyable
      Specified by:
      copy in interface XGettingCollection<E>
      Returns:
      a copy of this list