Class IntegerTextHandler

  • All Implemented Interfaces:
    IGUITextHandler

    public class IntegerTextHandler
    extends java.lang.Object
    implements IGUITextHandler
    Class to handle and format Set of Integers in the Editor.
    Author:
    Dennis Konoppa
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String rangeSeparator
      Separator for a range of integers.
      private static java.lang.String separator
      Separator for single integers.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String createTextAreaNumbers​(java.util.ArrayList<java.lang.Integer> numbers)
      Method to create format of lists of numbers in the Editor.
      java.lang.String format​(java.lang.String text)
      Method to create the format for a text.
      java.util.List<java.lang.Object> split​(java.lang.String format)
      Method to generate List of Objects from a given format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • separator

        private static java.lang.String separator
        Separator for single integers.
      • rangeSeparator

        private static java.lang.String rangeSeparator
        Separator for a range of integers.
    • Constructor Detail

      • IntegerTextHandler

        public IntegerTextHandler()
    • Method Detail

      • format

        public java.lang.String format​(java.lang.String text)
                                throws java.lang.NumberFormatException
        Description copied from interface: IGUITextHandler
        Method to create the format for a text.
        Specified by:
        format in interface IGUITextHandler
        Parameters:
        text - the text
        Returns:
        formats which is fitting for the text
        Throws:
        java.lang.NumberFormatException
      • split

        public java.util.List<java.lang.Object> split​(java.lang.String format)
                                               throws java.lang.NumberFormatException
        Description copied from interface: IGUITextHandler
        Method to generate List of Objects from a given format.
        Specified by:
        split in interface IGUITextHandler
        Parameters:
        format - the format which contains values of the Machine
        Returns:
        List of Objects which contains valid values for the Machine
        Throws:
        java.lang.NumberFormatException
      • createTextAreaNumbers

        public java.lang.String createTextAreaNumbers​(java.util.ArrayList<java.lang.Integer> numbers)
        Method to create format of lists of numbers in the Editor.
        Parameters:
        numbers - - List of numbers
        Returns:
        String with correct format for Editor