Class CDateTime.EditField

  • Enclosing class:
    CDateTime

    private class CDateTime.EditField
    extends java.lang.Object
    A simple class used for editing a field numerically.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String buffer  
      private int count  
      private int digits  
    • Constructor Summary

      Constructors 
      Constructor Description
      EditField​(int digits, int initialValue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean addChar​(char c)
      Adds a character if it is a digit; in case the field exceeds its capacity, the oldest character is dropped from the buffer.
      (package private) int getValue()  
      (package private) void removeLastCharacter()  
      (package private) void reset()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • buffer

        private java.lang.String buffer
      • digits

        private int digits
      • count

        private int count
    • Constructor Detail

      • EditField

        EditField​(int digits,
                  int initialValue)
    • Method Detail

      • addChar

        boolean addChar​(char c)
        Adds a character if it is a digit; in case the field exceeds its capacity, the oldest character is dropped from the buffer. Non-digits are dropped.
        Parameters:
        c -
        Returns:
        true if the new character is a digit and with its addition the active field reaches or exceeds its capacity, false otherwise
      • getValue

        int getValue()
      • removeLastCharacter

        void removeLastCharacter()
      • reset

        void reset()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object