Matches a float.

<p>If matched, the float value is extracted.
339533
public static DecomposableMatchBuilder1<Float, Float> caseFloat(MatchesAny f) {
    List<Matcher<Object>> matchers = new ArrayList<>();
    matchers.add(any());

    return new DecomposableMatchBuilder1<>(
        matchers, 0, new PrimitiveFieldExtractor<>(Float.class));
  }
245084
@Override
    public boolean matchesIndexValue(int v) {
        if (pattern.length() == 0) {
            return true;
        }
        int c = UTF16.charAt(pattern, 0);
        UnicodeMatcher m = data.lookupMatcher(c);
        return (m == null) ? ((c & 0xFF) == v) : m.matchesIndexValue(v);
    }
1220470
public static boolean isFloat(CharSequence self) {
        try {
            Float.valueOf(self.toString().trim());
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
1003508
public float getFloat( String key, float defaultValue )
        throws MissingResourceException
    {
        try
        {
            return getFloat( key );
        }
        catch( MissingResourceException mre )
        {
            return defaultValue;
        }
    }
916882
def match(self, item):
        
        if 0 and getattr(item, self._name):
            print "%r %r %r %r %r %r" % (self._cmp(float(getattr(item, self._name)), self._value),
                  self._name, self._condition, item.name, getattr(item, self._name), self._value)
        val = getattr(item, self._name) or 0
        if self.not_null and self._value and not val:
            return False
        else:
            return self._cmp(float(val), self._value)
176437
def _cast(self, value):
        
        if value.isdigit():
            value = int(value)
        elif re.compile("^\d+\.\d+").match(value):
            value = float(value)
        return value
82121
def get_float(self, key, optional=False):
        
        return self._get_typed_value(key, float, lambda x: float(x), optional)
610408
public static float toFloat(final Object value) {
		if (value instanceof Float) {
			return (float) value;
		}
		if (value == null) {
			return 0;
		}
		return new Float(value.toString());
	}
767865
public static boolean matches(String pattern, String value) {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(value);
        return m.matches();
    }
1068067
def _match(self, p, value):
        
        if self._is_operator(p):
            return self._match_operator(p, value)
        else:
            try:
                if self._is_value_filter(p):
                    return self._match_value_filter(p, value)
                else:
                    return self._match_key_filter(p, value)
            except KeyError:
                if self._suppress_key_errors or self._suppress_exceptions:
                    return False
                else:
                    raise
            except TypeError:
                if self._suppress_exceptions:
                    return False
                else:
                    raise
1034250
private static float[] getFloats(String s) {
    if (s.charAt(0) == 'z' | s.charAt(0) == 'Z') {
      return new float[0];
    }
    try {
      float[] results = new float[s.length()];
      int count = 0;
      int startPosition = 1;
      int endPosition = 0;

      ExtractFloatResult result = new ExtractFloatResult();
      int totalLength = s.length();

      // The startPosition should always be the first character of the
      // current number, and endPosition is the character after the current
      // number.
      while (startPosition < totalLength) {
        extract(s, startPosition, result);
        endPosition = result.mEndPosition;

        if (startPosition < endPosition) {
          results[count++] = Float.parseFloat(
              s.substring(startPosition, endPosition));
        }

        if (result.mEndWithNegSign) {
          // Keep the '-' sign with next number.
          startPosition = endPosition;
        } else {
          startPosition = endPosition + 1;
        }
      }
      return Utils.copyOf(results, count);
    } catch (NumberFormatException e) {
      Log.e(LOGTAG, "error in parsing \"" + s + "\"");
      throw e;
    }
  }
309919
@Pure
	@Inline(value = "$2.valueOf($1.floatValue())", imported = Float.class)
	public static Float toFloat(AtomicDouble number) {
		return Float.valueOf(number.floatValue());
	}
710793
public float getFloat(String key, float defaultValue) {
    if (containsKey(key)) {
      return Float.parseFloat(get(key));
    } else {
      return defaultValue;
    }
  }
1195158
private final float getJavaVersionAsFloat() {
		if (JAVA_VERSION == null) {
			return 0f;
		}

		String str = JAVA_VERSION.substring(0, 3);

		if (JAVA_VERSION.length() >= 5) {
			str = str + JAVA_VERSION.substring(4, 5);
		}

		return Float.parseFloat(str);
	}
1086717
function float(value) {
  var parsedFloat = Number.parseFloat(value);

  // couldn't parse it
  if (typeOf(parsedFloat) != 'number') {
    return throwModifierError('float', value, {message: 'Invalid Float'});
  }

  return parsedFloat;
}
1353878
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static float checkFloat(@Nonnull final Number number) {
		Check.notNull(number, "number");
		if (!isInFloatRange(number)) {
			throw new IllegalNumberRangeException(number.toString(), FLOAT_MIN, FLOAT_MAX);
		}

		return number.floatValue();
	}
491694
public final void mFloatingPointLiteral() throws RecognitionException {
		try {
			int _type = FloatingPointLiteral;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:5: ( Digits '.' ( Digits )? ( Exponent )? ( FloatTypeSuffix )? | '.' Digits ( Exponent )? ( FloatTypeSuffix )? | Digits Exponent ( FloatTypeSuffix )? | Digits ( Exponent )? FloatTypeSuffix )
			int alt16=4;
			alt16 = dfa16.predict(input);
			switch (alt16) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:9: Digits '.' ( Digits )? ( Exponent )? ( FloatTypeSuffix )?
					{
					mDigits(); 

					match('.'); 
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:20: ( Digits )?
					int alt9=2;
					int LA9_0 = input.LA(1);
					if ( ((LA9_0 >= '0' && LA9_0 <= '9')) ) {
						alt9=1;
					}
					switch (alt9) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:20: Digits
							{
							mDigits(); 

							}
							break;

					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:28: ( Exponent )?
					int alt10=2;
					int LA10_0 = input.LA(1);
					if ( (LA10_0=='E'||LA10_0=='e') ) {
						alt10=1;
					}
					switch (alt10) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:28: Exponent
							{
							mExponent(); 

							}
							break;

					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1315:38: ( FloatTypeSuffix )?
					int alt11=2;
					int LA11_0 = input.LA(1);
					if ( (LA11_0=='D'||LA11_0=='F'||LA11_0=='d'||LA11_0=='f') ) {
						alt11=1;
					}
					switch (alt11) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( input.LA(1)=='D'||input.LA(1)=='F'||input.LA(1)=='d'||input.LA(1)=='f' ) {
								input.consume();
							}
							else {
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1316:9: '.' Digits ( Exponent )? ( FloatTypeSuffix )?
					{
					match('.'); 
					mDigits(); 

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1316:20: ( Exponent )?
					int alt12=2;
					int LA12_0 = input.LA(1);
					if ( (LA12_0=='E'||LA12_0=='e') ) {
						alt12=1;
					}
					switch (alt12) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1316:20: Exponent
							{
							mExponent(); 

							}
							break;

					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1316:30: ( FloatTypeSuffix )?
					int alt13=2;
					int LA13_0 = input.LA(1);
					if ( (LA13_0=='D'||LA13_0=='F'||LA13_0=='d'||LA13_0=='f') ) {
						alt13=1;
					}
					switch (alt13) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( input.LA(1)=='D'||input.LA(1)=='F'||input.LA(1)=='d'||input.LA(1)=='f' ) {
								input.consume();
							}
							else {
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

					}

					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1317:9: Digits Exponent ( FloatTypeSuffix )?
					{
					mDigits(); 

					mExponent(); 

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1317:25: ( FloatTypeSuffix )?
					int alt14=2;
					int LA14_0 = input.LA(1);
					if ( (LA14_0=='D'||LA14_0=='F'||LA14_0=='d'||LA14_0=='f') ) {
						alt14=1;
					}
					switch (alt14) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( input.LA(1)=='D'||input.LA(1)=='F'||input.LA(1)=='d'||input.LA(1)=='f' ) {
								input.consume();
							}
							else {
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

					}

					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1318:9: Digits ( Exponent )? FloatTypeSuffix
					{
					mDigits(); 

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1318:16: ( Exponent )?
					int alt15=2;
					int LA15_0 = input.LA(1);
					if ( (LA15_0=='E'||LA15_0=='e') ) {
						alt15=1;
					}
					switch (alt15) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1318:16: Exponent
							{
							mExponent(); 

							}
							break;

					}

					mFloatTypeSuffix(); 

					}
					break;

			}
			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}