Interface ILcdShortList

All Superinterfaces:
Cloneable, Collection<Short>, ILcdCloneable, Iterable<Short>, List<Short>, SequencedCollection<Short>
All Known Implementing Classes:
TLcdShortArrayList

public interface ILcdShortList extends List<Short>, ILcdCloneable
A List interface that is optimized for shorts. It provides extra methods using short primitives, instead of Short objects.
Since:
9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    addAll(int aStartIndex, short[] aValues)
    Equivalent to addAll(aStartIndex, aValues, 0, aValues.length.
    default boolean
    addAll(int aStartIndex, short[] aValues, int aOffset, int aLength)
    Adds aLength boolean values from the given array to this list, starting from the given aOffset
    default boolean
    addAll(short[] aValues)
    Equivalent to addAll(size(), aValues, 0, aValues.length.
    default boolean
    addAll(short[] aValues, int aOffset, int aLength)
    Equivalent to addAll(size(), aValues, aOffset, aLength.
    void
    addShort(int aIndex, short aValue)
    Inserts the specified value at the specified position in this list (optional operation).
    boolean
    addShort(short aValue)
    Appends the specified value to the end of this list (optional operation).
    Creates and returns a copy of this object.
    boolean
    containsShort(short aValue)
    Returns true if this list contains the specified value.
    short
    getShort(int aIndex)
    Returns the value at the specified position in this list.
    int
    indexOfShort(short aValue)
    Returns the index of the first occurrence of the specified value in this list, or -1 if this list does not contain the value.
    int
    lastIndexOfShort(short aValue)
    Returns the index of the last occurrence of the specified value in this list, or -1 if this list does not contain the value.
    short
    removeShort(int aIndex)
    Removes the value at the specified position in this list (optional operation).
    boolean
    removeShort(short aValue)
    Removes the first occurrence of the specified value from this list, if it is present (optional operation).
    short
    setShort(int aIndex, short aValue)
    Replaces the value at the specified position in this list with the specified value (optional operation).
    short[]
    Returns an array containing all of the values in this list in proper sequence (from first to last value).
    short[]
    toShortArray(short[] anArray)
    Returns an array containing all of the values in this list in proper sequence (from first to last value); If the list fits in the specified array, t is returned therein.

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach
  • Method Details

    • getShort

      short getShort(int aIndex)
      Returns the value at the specified position in this list.
      Parameters:
      aIndex - index of the value to return
      Returns:
      the value at the specified position in this list
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).
    • setShort

      short setShort(int aIndex, short aValue)
      Replaces the value at the specified position in this list with the specified value (optional operation).
      Parameters:
      aIndex - index of the value to replace
      aValue - value to be stored at the specified position
      Returns:
      the value previously at the specified position
      Throws:
      UnsupportedOperationException - if the set operation is not supported by this list
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • addShort

      boolean addShort(short aValue)
      Appends the specified value to the end of this list (optional operation).
      Parameters:
      aValue - value to be appended to this list
      Returns:
      true
      Throws:
      UnsupportedOperationException - if the add operation is not supported by this list
    • addShort

      void addShort(int aIndex, short aValue)
      Inserts the specified value at the specified position in this list (optional operation). Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices).
      Parameters:
      aIndex - index at which the specified value is to be inserted
      aValue - value to be inserted
      Throws:
      UnsupportedOperationException - if the add operation is not supported by this list
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index > size())
    • addAll

      default boolean addAll(short[] aValues)
      Equivalent to addAll(size(), aValues, 0, aValues.length.
      Since:
      2018.0
      See Also:
    • addAll

      default boolean addAll(short[] aValues, int aOffset, int aLength)
      Equivalent to addAll(size(), aValues, aOffset, aLength.
      Since:
      2018.0
      See Also:
    • addAll

      default boolean addAll(int aStartIndex, short[] aValues)
      Equivalent to addAll(aStartIndex, aValues, 0, aValues.length.
      Since:
      2018.0
      See Also:
    • addAll

      default boolean addAll(int aStartIndex, short[] aValues, int aOffset, int aLength)
      Adds aLength boolean values from the given array to this list, starting from the given aOffset
      Parameters:
      aStartIndex - The position in this list where to start inserting the given boolean values.
      aValues - The array containing the boolean values to add to this list
      aOffset - The offset in aValues from where to start copying the boolean values
      aLength - The number of boolean values to copy from aValues to this list.
      Returns:
      Whether this list was modified as a result of this call.
      Throws:
      IndexOutOfBoundsException - if aStartIndex is less than zero or larger than the current size of this list.
      IndexOutOfBoundsException - if aOffset + aLength exceeds the length of aValues
      IndexOutOfBoundsException - if aOffset is negative
      IndexOutOfBoundsException - if aLength is negative
      Since:
      2018.0
    • removeShort

      boolean removeShort(short aValue)
      Removes the first occurrence of the specified value from this list, if it is present (optional operation). If this list does not contain the value, it is unchanged. Returns true if this list contained the specified value (or equivalently, if this list changed as a result of the call).
      Parameters:
      aValue - value to be removed from this list, if present
      Returns:
      true if this list contained the specified value
      Throws:
      UnsupportedOperationException - if the remove operation is not supported by this list
    • removeShort

      short removeShort(int aIndex)
      Removes the value at the specified position in this list (optional operation). Shifts any subsequent values to the left (subtracts one from their indices). Returns the value that was removed from the list.
      Parameters:
      aIndex - the index of the value to be removed
      Returns:
      the value previously at the specified position
      Throws:
      UnsupportedOperationException - if the remove operation is not supported by this list
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
    • toShortArray

      short[] toShortArray()
      Returns an array containing all of the values in this list in proper sequence (from first to last value). The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.
      Returns:
      an array containing all of the values in this list in proper sequence
    • toShortArray

      short[] toShortArray(short[] anArray)
      Returns an array containing all of the values in this list in proper sequence (from first to last value); If the list fits in the specified array, t is returned therein. Otherwise, a new array is allocated with the size of this list. If the list fits in the specified array with room to spare (i.e., the array has more values than the list), the value in the array immediately following the end of the list is set to 0. (This is useful in determining the length of the list only if the caller knows that the list does not contain any 0 values.)
      Parameters:
      anArray - the array into which the values of this list are to be stored, if it is big enough; otherwise, a new array is allocated for this purpose.
      Returns:
      an array containing the values of this list
      Throws:
      NullPointerException - if the specified array is null
    • containsShort

      boolean containsShort(short aValue)
      Returns true if this list contains the specified value.
      Parameters:
      aValue - value whose presence in this list is to be tested
      Returns:
      true if this list contains the specified value
    • indexOfShort

      int indexOfShort(short aValue)
      Returns the index of the first occurrence of the specified value in this list, or -1 if this list does not contain the value.
      Parameters:
      aValue - value to search for
      Returns:
      the index of the first occurrence of the specified value in this list, or -1 if this list does not contain the value
    • lastIndexOfShort

      int lastIndexOfShort(short aValue)
      Returns the index of the last occurrence of the specified value in this list, or -1 if this list does not contain the value.
      Parameters:
      aValue - value to search for
      Returns:
      the index of the last occurrence of the specified value in this list, or -1 if this list does not contain the value
    • clone

      ILcdShortList clone()
      Creates and returns a copy of this object.
      Specified by:
      clone in interface ILcdCloneable
      Returns:
      a copy of this object.
      See Also: