Class FloatValueConverter

java.lang.Object
org.eclipse.xtext.conversion.impl.AbstractValueConverter<Double>
org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<Double>
net.ssehub.easy.dslCore.values.FloatValueConverter
All Implemented Interfaces:
org.eclipse.xtext.conversion.IValueConverter<Double>, org.eclipse.xtext.conversion.IValueConverter.RuleSpecific

public class FloatValueConverter extends org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<Double>
Converts strings recognized by the grammar to float values.
Author:
Holger Eichelberger
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.xtext.conversion.IValueConverter

    org.eclipse.xtext.conversion.IValueConverter.RuleSpecific
  • Field Summary

    Fields inherited from interface org.eclipse.xtext.conversion.IValueConverter

    NO_OP_CONVERTER
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a float value converter.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected String
     
    toValue(String string, org.eclipse.xtext.nodemodel.INode node)
    Returns a double value for the given string stored in node.

    Methods inherited from class org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter

    assertTokens, assertTokens, createTokenContentMismatchException, createTokenTypeMismatchException, getLexer, getLexerProvider, getRule, getRuleName, getRuleName, getTokenDefMap, getTokenDefProvider, getTokenSource, setLexerProvider, setRule, setTokenDefProvider, toString

    Methods inherited from class java.lang.Object

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

    • FloatValueConverter

      public FloatValueConverter()
      Creates a float value converter.
  • Method Details

    • toEscapedString

      protected String toEscapedString(Double value)
      Overrides:
      toEscapedString in class org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<Double>
    • assertValidValue

      protected void assertValidValue(Double value)
      Overrides:
      assertValidValue in class org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<Double>
    • toValue

      public Double toValue(String string, org.eclipse.xtext.nodemodel.INode node)
      Returns a double value for the given string stored in node.
      Parameters:
      string - the version string to be converted
      node - the node holding the string
      Returns:
      the converted double value
      Throws:
      org.eclipse.xtext.conversion.ValueConverterException - in case of conversion problems