congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JsonValue.isNumber
Code IndexAdd Tabnine to your IDE (free)

How to use
isNumber
method
in
org.hjson.JsonValue

Best Java code snippets using org.hjson.JsonValue.isNumber (Showing top 7 results out of 315)

origin: org.hjson/hjson

 public String stringify(JsonValue value)
 {
  if (!value.isNumber()) return null;
  double val=value.asDouble();
  if (val==Double.POSITIVE_INFINITY) return "Inf";
  else if (val==Double.NEGATIVE_INFINITY) return "-Inf";
  else if (Double.isNaN(val)) return "NaN";
  else if (val==0.0 && 1/val==Double.NEGATIVE_INFINITY) return "-0";
  else return null;
 }
}
origin: hjson/hjson-java

 public String stringify(JsonValue value)
 {
  if (!value.isNumber()) return null;
  double val=value.asDouble();
  if (val==Double.POSITIVE_INFINITY) return "Inf";
  else if (val==Double.NEGATIVE_INFINITY) return "-Inf";
  else if (Double.isNaN(val)) return "NaN";
  else if (val==0.0 && 1/val==Double.NEGATIVE_INFINITY) return "-0";
  else return null;
 }
}
origin: org.hjson/hjson

 public String stringify(JsonValue value)
 {
  if (stringify && value.isNumber() && value.asLong()==value.asDouble())
  {
   return "0x"+Long.toHexString(value.asLong());
  }
  else
  {
   return null;
  }
 }
}
origin: hjson/hjson-java

 public String stringify(JsonValue value)
 {
  if (stringify && value.isNumber() && value.asLong()==value.asDouble())
  {
   return "0x"+Long.toHexString(value.asLong());
  }
  else
  {
   return null;
  }
 }
}
origin: net.akehurst.application.framework/net.akehurst.application.framework.technology.persistence.filesystem

Object convertJsonToJava(final JsonValue value) throws PersistentStoreException {
  if (null == value) {
    return null;
  } else if (value.isString()) {
    return value.asString();
  } else if (value.isNumber()) {
    return value.asDouble();
  } else if (value.isBoolean()) {
    return value.asBoolean();
  } else if (value.isArray()) {
    final List<Object> list = new ArrayList<>();
    for (final JsonValue av : value.asArray()) {
      final Object o = this.convertJsonToJava(av);
      list.add(o);
    }
    return list;
  } else if (value.isObject()) {
    final Map<String, Object> map = new HashMap<>();
    for (final String k : value.asObject().names()) {
      final JsonValue jv = value.asObject().get(k);
      final Object v = this.convertJsonToJava(jv);
      map.put(k, v);
    }
    return map;
  } else {
    throw new PersistentStoreException("Unknown JSON type.", null);
  }
}
origin: net.akehurst.application.framework/net.akehurst.application.framework.technology.persistence.filesystem

  final T t = this.af.createDatatype(itemType, value.asString());
  return t;
} else if (value.isNumber()) {
  final T t = this.af.createDatatype(itemType, value.asDouble());
  return t;
origin: TridentSDK/TridentSDK

for (int i = 0, j = array.size(); i < j; i++) {
  JsonValue el = array.get(i);
  if (el.isString() || el.isNumber() || el.isBoolean())
    cc.addWith(el.asString());
  else if (el.isObject())
for (int i = 0, j = array.size(); i < j; i++) {
  JsonValue el = array.get(i);
  if (el.isString() || el.isNumber() || el.isBoolean())
    cc.addExtra(el.asString());
  else if (el.isObject())
org.hjsonJsonValueisNumber

Javadoc

Detects whether this value represents a JSON number.

Popular methods of JsonValue

  • toString
    Returns the JSON/Hjson string for this value using the given formatting.
  • readHjson
    Reads a Hjson value from the given string.
  • asObject
    Returns this JSON value as JsonObject, assuming that this value represents a JSON object. If this is
  • asString
    Returns this JSON value as String, assuming that this value represents a JSON string. If this is not
  • asArray
    Returns this JSON value as JsonArray, assuming that this value represents a JSON array. If this is n
  • asBoolean
    Returns this JSON value as a boolean value, assuming that this value is either true or false. If thi
  • writeTo
    Writes the JSON/Hjson representation of this value to the given writer using the given formatting. W
  • asDouble
    Returns this JSON value as a double value, assuming that this value represents a JSON number. If thi
  • equals
    Indicates whether some other object is "equal to" this one according to the contract specified in Ob
  • hashCode
  • readJSON
    Reads a JSON value from the given string.
  • asFloat
    Returns this JSON value as a float value, assuming that this value represents a JSON number. If this
  • readJSON,
  • asFloat,
  • asInt,
  • asLong,
  • getType,
  • isBoolean,
  • isObject,
  • isPunctuatorChar,
  • isString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • findViewById (Activity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now