Class ArrayISeq<T>

java.lang.Object
ArraySeq<T>
ArrayISeq<T>
All Implemented Interfaces:
BaseSeq<T>, Copyable<MSeq<T>>, ISeq<T>, Seq<T>, Serializable, Iterable<T>, IntFunction<T>, RandomAccess
Direct Known Subclasses:
CharSeq

public class ArrayISeq<T> extends ArraySeq<T> implements ISeq<T>
Since:
1.4
Version:
3.4
See Also:
  • Constructor Details

  • Method Details

    • map

      public <B> ISeq<B> map(Function<? super T,? extends B> mapper)
      Description copied from interface: Seq
      Builds a new sequence by applying a function to all elements of this sequence.
      Specified by:
      map in interface ISeq<T>
      Specified by:
      map in interface Seq<T>
      Type Parameters:
      B - the element type of the returned collection.
      Parameters:
      mapper - the function to apply to each element.
      Returns:
      a new sequence of type That resulting from applying the given function f to each element of this sequence and collecting the results.
    • append

      public ISeq<T> append(Iterable<? extends T> values)
      Description copied from interface: Seq
      Return a new Seq with the given values appended.
      Specified by:
      append in interface ISeq<T>
      Specified by:
      append in interface Seq<T>
      Parameters:
      values - the values to append
      Returns:
      a new Seq with the elements of this sequence and the given values appended.
    • prepend

      public ISeq<T> prepend(Iterable<? extends T> values)
      Description copied from interface: Seq
      Return a new Seq with the given values prepended.
      Specified by:
      prepend in interface ISeq<T>
      Specified by:
      prepend in interface Seq<T>
      Parameters:
      values - the values to append
      Returns:
      a new Seq with the elements of this sequence and the given values prepended.
    • subSeq

      public ISeq<T> subSeq(int start)
      Description copied from interface: Seq
      Returns a view of the portion of this sequence between the specified start, inclusive, and end, exclusive. (If start and end are equal, the returned sequence has the length zero.) The returned sequence is backed by this sequence, so non-structural changes in the returned sequence are reflected in this sequence, and vice-versa.

      This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects an sequence can be used as a range operation by passing an sub sequence view instead of an whole sequence.

      Specified by:
      subSeq in interface ISeq<T>
      Specified by:
      subSeq in interface Seq<T>
      Parameters:
      start - lower end point (inclusive) of the sub array.
      Returns:
      a view of the specified range within this array.
    • subSeq

      public ISeq<T> subSeq(int start, int end)
      Description copied from interface: Seq
      Returns a view of the portion of this sequence between the specified start, inclusive, and end, exclusive. (If start and end are equal, the returned sequence has the length zero.) The returned sequence is backed by this sequence, so non-structural changes in the returned sequence are reflected in this array, and vice-versa.

      This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects an array can be used as a range operation by passing an sub sequence view instead of an whole sequence.

      Specified by:
      subSeq in interface ISeq<T>
      Specified by:
      subSeq in interface Seq<T>
      Parameters:
      start - low end point (inclusive) of the sub sequence.
      end - high end point (exclusive) of the sub sequence.
      Returns:
      a view of the specified range within this sequence.
    • copy

      public MSeq<T> copy()
      Description copied from interface: ISeq
      Return a shallow copy of this sequence. The sequence elements are not cloned.
      Specified by:
      copy in interface Copyable<T>
      Specified by:
      copy in interface ISeq<T>
      Returns:
      a shallow copy of this sequence.