Class ListBoolean

  • Direct Known Subclasses:
    ArrayBoolean

    public abstract class ListBoolean
    extends Object
    An ordered collection of booleans. Since in Java Boolean does not inherit from Number, ListBoolean does not inherit from ListNumber.
    Author:
    Gabriele Carcassi
    • Constructor Detail

      • ListBoolean

        public ListBoolean()
    • Method Detail

      • getBoolean

        public abstract boolean getBoolean​(int index)
        Returns the element at the specified position in this list.
        Parameters:
        index - position of the element to return
        Returns:
        the element at the specified position in this list
        Throws:
        IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
      • setBoolean

        public abstract void setBoolean​(int index,
                                        boolean value)
        Changes the element at the specified position.
        Parameters:
        index - position of the element to change
        value - the new value
        Throws:
        IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())
      • size

        public abstract int size()
        Returns the number of elements in the collection.
        Returns:
        the number of elements in the collection
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object