Class Slice

java.lang.Object
org.wpilib.math.autodiff.Slice

public class Slice extends Object
Represents a sequence of elements in an iterable object.
  • Field Details

    • __

      public static final Slice.None __
      Designates an omitted argument of the slice.
    • start

      public int start
      Start index (inclusive).
    • stop

      public int stop
      Stop index (exclusive).
    • step

      public int step
      Step.
  • Constructor Details

    • Slice

      public Slice()
      Constructs a Slice.
    • Slice

      public Slice(Slice.None start)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
    • Slice

      public Slice(int start)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
    • Slice

      public Slice(Slice.None start, Slice.None stop)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
    • Slice

      public Slice(Slice.None start, int stop)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
    • Slice

      public Slice(int start, Slice.None stop)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
    • Slice

      public Slice(int start, int stop)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
    • Slice

      public Slice(Slice.None start, Slice.None stop, Slice.None step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(Slice.None start, Slice.None stop, int step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(Slice.None start, int stop, Slice.None step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(Slice.None start, int stop, int step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(int start, Slice.None stop, Slice.None step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(int start, Slice.None stop, int step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(int start, int stop, Slice.None step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(int start, int stop, int step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
    • Slice

      public Slice(OptionalInt start, OptionalInt stop, OptionalInt step)
      Constructs a slice.
      Parameters:
      start - Slice start index (inclusive).
      stop - Slice stop index (exclusive).
      step - Slice step.
  • Method Details

    • adjust

      public int adjust(int length)
      Adjusts start and end slice indices assuming a sequence of the specified length.
      Parameters:
      length - The sequence length.
      Returns:
      The slice length.