Package snap.util

Class Range

java.lang.Object
snap.util.Range

public class Range extends Object
A class to represent start and end values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     
    final int
     
    final int
     
    final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Range(int aStart, int anEnd)
    Creates a range with start/end.
    Range(int aStart, int anEnd, int anAnchor)
    Creates a range, with start/end/anchor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the end.
    int
    Returns the length.
    int
    Returns the start.
    boolean
    Returns whether range is empty.
    Standard toString implementation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • start

      public final int start
    • end

      public final int end
    • length

      public final int length
    • anchor

      public final int anchor
  • Constructor Details

    • Range

      public Range(int aStart, int anEnd)
      Creates a range with start/end.
    • Range

      public Range(int aStart, int anEnd, int anAnchor)
      Creates a range, with start/end/anchor.
  • Method Details

    • getStart

      public int getStart()
      Returns the start.
    • getEnd

      public int getEnd()
      Returns the end.
    • getLength

      public int getLength()
      Returns the length.
    • isEmpty

      public boolean isEmpty()
      Returns whether range is empty.
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object