Package groovy.lang

Class NonEmptySequence

All Implemented Interfaces:
GroovyObject, Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class NonEmptySequence extends Sequence
Represents a sequence of one or more objects of a given type. The type can be omitted in which case any type of object can be added.
See Also:
  • Constructor Details

    • NonEmptySequence

      public NonEmptySequence()
      Creates a non-empty sequence with no type restriction.
    • NonEmptySequence

      public NonEmptySequence(Class type)
      Creates a non-empty sequence constrained to the supplied type.
      Parameters:
      type - the allowed element type
    • NonEmptySequence

      public NonEmptySequence(Class type, List content)
      Creates a non-empty sequence initialized with the supplied content.
      Parameters:
      type - the allowed element type
      content - the initial content
  • Method Details

    • minimumSize

      public int minimumSize()
      Returns the minimum allowed size for this sequence.
      Overrides:
      minimumSize in class Sequence
      Returns:
      the minimum size