Class InputFormat

java.lang.Object
de.redstoneworld.redutilities.input.InputFormat

public class InputFormat extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    This method validate the input string and check if it's a valid integer.
    static boolean
    This method validate the input string and check if it's a valid natural number without a signum of a permutation.
    static boolean
    This method validate the input string and check if it's a valid natural number without a signum of a permutation, and it's also greater than zero.
    static boolean
    This method validate the input string and check if it's a valid rational number.

    Methods inherited from class java.lang.Object

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

    • InputFormat

      public InputFormat()
  • Method Details

    • isNaturalNumber

      public static boolean isNaturalNumber(String cmdInput)
      This method validate the input string and check if it's a valid natural number without a signum of a permutation.
      Returns:
      'true' if the input is a natural number
    • isPositiveNaturalNumber

      public static boolean isPositiveNaturalNumber(String cmdInput)
      This method validate the input string and check if it's a valid natural number without a signum of a permutation, and it's also greater than zero.
      Returns:
      'true' if the input is a positive natural number
    • isIntegerNumber

      public static boolean isIntegerNumber(String cmdInput)
      This method validate the input string and check if it's a valid integer.
      Returns:
      'true' if the input is an integer
    • isRationalNumber

      public static boolean isRationalNumber(String cmdInput)
      This method validate the input string and check if it's a valid rational number. Flexible inputs are allowed, which improves the usability. (Input-Formatter: 'Formatter.getRationalNumberValue')
      Returns:
      'true' if the input is a rational number