Class CharRange

java.lang.Object
org.getalp.dbnary.tools.CharRange

public final class CharRange extends Object
Simmplified from org apache commons lang 2.5.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CharRange(char ch)
    Constructs a CharRange over a single character.
    CharRange(int start, int end)
    Constructs a CharRange over a set of characters.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(char c)
    check if a char is inside the current range.
    boolean
    contains(int c)
    check if a code point is inside the current range.
    int
    Gets the end character for this character range.
    int
    Gets the start character for this character range.
    Gets a string representation of the character range.

    Methods inherited from class Object

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

    • CharRange

      public CharRange(char ch)

      Constructs a CharRange over a single character.

      Parameters:
      ch - only character in this range
    • CharRange

      public CharRange(int start, int end)

      Constructs a CharRange over a set of characters.

      Parameters:
      start - first character, inclusive, in this range
      end - last character, inclusive, in this range
  • Method Details

    • getStart

      public int getStart()

      Gets the start character for this character range.

      Returns:
      the start char (inclusive)
    • getEnd

      public int getEnd()

      Gets the end character for this character range.

      Returns:
      the end char (inclusive)
    • contains

      public boolean contains(char c)

      check if a char is inside the current range.

      Parameters:
      c - the character to check
      Returns:
      true if the range contains c
    • contains

      public boolean contains(int c)

      check if a code point is inside the current range.

      Parameters:
      c - the code point to check
      Returns:
      true if the range contains c
    • toString

      public String toString()

      Gets a string representation of the character range.

      Overrides:
      toString in class Object
      Returns:
      string representation of this range