Package fj.data

Class List.Cons<A>

  • All Implemented Interfaces:
    java.lang.Iterable<A>
    Enclosing class:
    List<A>

    private static final class List.Cons<A>
    extends List<A>
    • Field Detail

      • head

        private final A head
      • tail

        private List<A> tail
    • Constructor Detail

      • Cons

        Cons​(A head,
             List<A> tail)
    • Method Detail

      • head

        public A head()
        Description copied from class: List
        The first element of the linked list or fails for the empty list.
        Specified by:
        head in class List<A>
        Returns:
        The first element of the linked list or fails for the empty list.
      • tail

        public List<A> tail()
        Description copied from class: List
        The list without the first element or fails for the empty list.
        Specified by:
        tail in class List<A>
        Returns:
        The list without the first element or fails for the empty list.
      • tail

        private void tail​(List<A> tail)