com.io7m.jstructural.core

## Class SNonEmptyList<T>

- java.lang.Object
- - com.io7m.jstructural.core.SNonEmptyList<T>

- Type Parameters:
    `T` - The type of elements

      @Immutable
      public final class SNonEmptyList<T>
      extends Object

  The type of non-empty lists.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `List<T>` | `getElements()`
    `int` | `hashCode()`
    `static <T> SNonEmptyList<T>` | `newList(List<T> elements)` Construct a new non-empty list from the given list
    `static <T> SNonEmptyList<T>` | `one(T e)` Construct a new non-empty list from the given element
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### newList

          @Nonnull
          public static <T> SNonEmptyList<T> newList(@Nonnull
                                             List<T> elements)
                                          throws com.io7m.jaux.Constraints.ConstraintError

      Construct a new non-empty list from the given list
      Type Parameters:
        `T` - The type of elements
      Parameters:
        `elements` - The list of elements
      Returns:
        A non-empty list
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If the list is empty

    - #### one

          @Nonnull
          public static <T> SNonEmptyList<T> one(@Nonnull
                                         T e)
                                      throws com.io7m.jaux.Constraints.ConstraintError

      Construct a new non-empty list from the given element
      Type Parameters:
        `T` - The type of elements
      Parameters:
        `e` - A single element
      Returns:
        A non-empty list
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If the list is empty

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getElements

          @Nonnull
          public List<T> getElements()

      Returns:
        A read-only view of the list.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014 <code@io7m.com> http://io7m.com