Interface ImmutableList<E>

All Superinterfaces:
java.lang.Iterable<E>

public interface ImmutableList<E>
extends java.lang.Iterable<E>
Author:
Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
  • Method Summary

    Modifier and Type Method Description
    E head()  
    boolean isEmpty()  
    ImmutableList<E> tail()  

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • head

      E head()
      Returns:
      the head value if it is present
      Throws:
      java.util.NoSuchElementException - if empty
    • tail

      ImmutableList<E> tail()
      Returns:
      the tail if it is present
      Throws:
      java.util.NoSuchElementException - if empty
    • isEmpty

      boolean isEmpty()
      Returns:
      true if empty, false otherwise