Interface XPuttingCollection<E>

Type Parameters:
E - type of contained elements
All Superinterfaces:
CapacityCarrying, CapacityExtendable, Consumer<E>, ExtendedCollection<E>, OptimizableCollection, Sized, XAddingCollection<E>
All Known Subinterfaces:
XBag<E>, XBasicEnum<E>, XBasicList<E>, XBasicSequence<E>, XBasicTable<K,​V>, XBasicTable.Keys<K,​V>, XChart<K,​V>, XChart.Keys<K,​V>, XCollection<E>, XEnum<E>, XExpandingEnum<E>, XExpandingList<E>, XExpandingSequence<E>, XIncreasingEnum<E>, XIncreasingList<E>, XIncreasingSequence<E>, XInputtingEnum<E>, XInputtingList<E>, XInputtingSequence<E>, XLadder<E>, XList<E>, XMap<K,​V>, XMap.Keys<K,​V>, XPutGetBag<E>, XPutGetCollection<E>, XPutGetEnum<E>, XPutGetList<E>, XPutGetSequence<E>, XPutGetSet<E>, XPutGetSortation<E>, XPuttingBag<E>, XPuttingEnum<E>, XPuttingList<E>, XPuttingSequence<E>, XPuttingSet<E>, XPuttingSortation<E>, XRank<E>, XSequence<E>, XSet<E>, XSortation<E>, XTable<K,​V>, XTable.Keys<K,​V>
All Known Implementing Classes:
ArrayCollector, BulkList, Collector, EqBulkList, EqHashEnum, EqHashTable, EqHashTable.Keys, HashEnum, HashTable, HashTable.Keys, LimitList, LockedCollection, LockedList, LockedMap, MutexSet, OpenAdressingMiniSet, Single, SubCollector, SubList, SynchCollection, SynchList, SynchSet

public interface XPuttingCollection<E>
extends XAddingCollection<E>
Putting aspect:
Ensure that all putted elements are contained in the collection

Examples: Set: Add all elements, overwriting equal already contained elements. Bag: Always add all elements (identical to add)

Note: Corresponds to the Java collections add() for single dimensional collections and put() for Map.

  • Method Details

    • put

      boolean put​(E element)
      Adds the specified element to this collection if it is not already present (optional operation).
      Parameters:
      element - to add
      Returns:
      true if this collection did not already contain the specified element
    • nullPut

      boolean nullPut()
    • putAll

      XPuttingCollection<E> putAll​(E... elements)
      Adds the specified elements to this collection if it is not already present (optional operation).
      Parameters:
      elements - to add
      Returns:
      this
    • putAll

      XPuttingCollection<E> putAll​(E[] elements, int srcStartIndex, int srcLength)
      Adds the specified elements to this collection if it is not already present (optional operation).
      Only the elements with indizes from the srcStartIndex to the srcStartIndex+srcLength are put in the collection.
      Parameters:
      elements - to add
      srcStartIndex - start index of elements-array to add to collection
      srcLength - length of elements-array to add to collection
      Returns:
      this
    • putAll

      XPuttingCollection<E> putAll​(XGettingCollection<? extends E> elements)
      Adds the specified elements to this collection if it is not already present (optional operation).
      Parameters:
      elements - to add
      Returns:
      this