< prev index next >

modules/javafx.base/src/main/java/javafx/util/converter/FormatStringConverter.java

Print this page




  75         return result;
  76     }
  77 
  78     /** {@inheritDoc} */
  79     @Override public String toString(T value) {
  80         // If the specified value is null, return a zero-length String
  81         if (value == null) {
  82             return "";
  83         }
  84 
  85         // Create and configure the formatter to be used
  86         Format _format = getFormat();
  87 
  88         // Perform the requested formatting
  89         return _format.format(value);
  90     }
  91 
  92     /**
  93      * <p>Return a <code>Format</code> instance to use for formatting
  94      * and parsing in this {@link StringConverter}.</p>


  95      */
  96     protected Format getFormat() {
  97         return format;
  98     }
  99 }


  75         return result;
  76     }
  77 
  78     /** {@inheritDoc} */
  79     @Override public String toString(T value) {
  80         // If the specified value is null, return a zero-length String
  81         if (value == null) {
  82             return "";
  83         }
  84 
  85         // Create and configure the formatter to be used
  86         Format _format = getFormat();
  87 
  88         // Perform the requested formatting
  89         return _format.format(value);
  90     }
  91 
  92     /**
  93      * <p>Return a <code>Format</code> instance to use for formatting
  94      * and parsing in this {@link StringConverter}.</p>
  95      *
  96      * @return A {@code Format} instance for formatting and parsing in this {@link StringConverter}
  97      */
  98     protected Format getFormat() {
  99         return format;
 100     }
 101 }
< prev index next >