Interface Sequential<E>

Type Parameters:
E - The type of element that makes up the sequence.
All Superinterfaces:
Iterable<E>

public interface Sequential<E> extends Iterable<E>
This interface should be implemented by classes that define a sequence of elements that can be iterated over in a sequential manner.
Author:
Derk Norton
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    This method returns the number of elements in the sequence.
    default boolean
    This method checks to see if the sequence is empty.
    default Iterator<E>
     
    E[]
    This method returns an array containing the elements in the sequence.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • createIterator

      Iterator<E> createIterator()
    • isEmpty

      default boolean isEmpty()
      This method checks to see if the sequence is empty.
      Returns:
      Whether or not the sequence is empty.
    • getSize

      int getSize()
      This method returns the number of elements in the sequence.
      Returns:
      The number of elements in the sequence.
    • toArray

      E[] toArray()
      This method returns an array containing the elements in the sequence.
      Returns:
      array An array containing the elements from the sequence.
    • iterator

      default Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E>