com.orsoncharts.interaction

## Class StandardXYZDataItemSelection<S>

- java.lang.Object
- - com.orsoncharts.interaction.StandardXYZDataItemSelection<S>

- All Implemented Interfaces:
    XYZDataItemSelection

      public class StandardXYZDataItemSelection<S>
      extends java.lang.Object
      implements XYZDataItemSelection

  An object that tracks selected items from an `XYZDataset`.
  Since:
    1.3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardXYZDataItemSelection()` Creates a new (empty) selection.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(XYZItemKey item)` Adds an item to the selection, returns `true` if the item was added and `false` if it already existed in the selection.
    `boolean` | `addAll(java.util.Collection<XYZItemKey> keys)` Adds all the items from the specified collection, returning `true` if the selection is updated or `false` if all the supplied keys are already present in the selection.
    `void` | `clear()` Clears the selection.
    `boolean` | `isSelected(XYZItemKey item)` Returns `true` if the item is present in the selection, and `false` otherwise.
    `boolean` | `remove(XYZItemKey item)` Removes an item from the selection, returning `true` if the item was removed and `false` if it was not present in the selection.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardXYZDataItemSelection

          public StandardXYZDataItemSelection()

      Creates a new (empty) selection.

  - ### Method Detail

    - #### add

          public boolean add(XYZItemKey item)

      Adds an item to the selection, returns `true` if the item was added and `false` if it already existed in the selection.
      Parameters:
        `item` - the item key (`null` not permitted).
      Returns:
        A boolean.

    - #### addAll

          public boolean addAll(java.util.Collection<XYZItemKey> keys)

      Adds all the items from the specified collection, returning `true` if the selection is updated or `false` if all the supplied keys are already present in the selection.
      Parameters:
        `keys` - the keys (`null` not permitted).
      Returns:
        A boolean.

    - #### remove

          public boolean remove(XYZItemKey item)

      Removes an item from the selection, returning `true` if the item was removed and `false` if it was not present in the selection.
      Parameters:
        `item` - the item (`null` not permitted).
      Returns:
        A boolean.

    - #### isSelected

          public boolean isSelected(XYZItemKey item)

      Returns `true` if the item is present in the selection, and `false` otherwise.
      Specified by:
        `isSelected` in interface `XYZDataItemSelection`
      Parameters:
        `item` - the item `null` not permitted).
      Returns:
        A boolean.

    - #### clear

          public void clear()

      Clears the selection.