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

How to use
JsonNumber
in
org.hjson

Best Java code snippets using org.hjson.JsonNumber (Showing top 16 results out of 315)

origin: org.hjson/hjson

/**
 * Returns a JsonValue instance that represents the given <code>long</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(long value) {
 return new JsonNumber(value);
}
origin: hjson/hjson-java

/**
 * Returns a JsonValue instance that represents the given <code>long</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(long value) {
 return new JsonNumber(value);
}
origin: org.hjson/hjson

/**
 * Returns a JsonValue instance that represents the given <code>int</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(int value) {
 return new JsonNumber(value);
}
origin: org.hjson/hjson

/**
 * Returns a JsonValue instance that represents the given <code>double</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(double value) {
 return new JsonNumber(value);
}
origin: org.hjson/hjson

/**
 * Returns a JsonValue instance that represents the given <code>float</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(float value) {
 return new JsonNumber(value);
}
origin: hjson/hjson-java

/**
 * Returns a JsonValue instance that represents the given <code>float</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(float value) {
 return new JsonNumber(value);
}
origin: hjson/hjson-java

/**
 * Returns a JsonValue instance that represents the given <code>double</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(double value) {
 return new JsonNumber(value);
}
origin: hjson/hjson-java

/**
 * Returns a JsonValue instance that represents the given <code>int</code> value.
 *
 * @param value the value to get a JSON representation for
 * @return a JSON value that represents the given value
 */
public static JsonValue valueOf(int value) {
 return new JsonNumber(value);
}
origin: org.hjson/hjson

public JsonValue parse(String text)
{
 switch (text)
 {
  case "+inf":
  case "inf":
  case "+Inf":
  case "Inf":
   return new JsonNumber(Double.POSITIVE_INFINITY);
  case "-inf":
  case "-Inf":
   return new JsonNumber(Double.NEGATIVE_INFINITY);
  case "nan":
  case "NaN":
   return new JsonNumber(Double.NaN);
  default:
   return null;
 }
}
origin: hjson/hjson-java

public JsonValue parse(String text)
{
 switch (text)
 {
  case "+inf":
  case "inf":
  case "+Inf":
  case "Inf":
   return new JsonNumber(Double.POSITIVE_INFINITY);
  case "-inf":
  case "-Inf":
   return new JsonNumber(Double.NEGATIVE_INFINITY);
  case "nan":
  case "NaN":
   return new JsonNumber(Double.NaN);
  default:
   return null;
 }
}
origin: org.hjson/hjson

public JsonValue parse(String text)
{
 if (isHex.matcher(text).find())
  return new JsonNumber(Long.parseLong(text.substring(2), 16));
 else
  return null;
}
origin: hjson/hjson-java

public JsonValue parse(String text)
{
 if (isHex.matcher(text).find())
  return new JsonNumber(Long.parseLong(text.substring(2), 16));
 else
  return null;
}
origin: org.hjson/hjson

return new JsonNumber(Double.parseDouble(value.substring(0, last)));
origin: hjson/hjson-java

return new JsonNumber(Double.parseDouble(value.substring(0, last)));
origin: org.hjson/hjson

private JsonValue readNumber() throws IOException {
 startCapture();
 readIf('-');
 int firstDigit=current;
 if (!readDigit()) {
  throw expected("digit");
 }
 if (firstDigit!='0') {
  while (readDigit()) {
  }
 }
 readFraction();
 readExponent();
 return new JsonNumber(Double.parseDouble(endCapture()));
}
origin: hjson/hjson-java

private JsonValue readNumber() throws IOException {
 startCapture();
 readIf('-');
 int firstDigit=current;
 if (!readDigit()) {
  throw expected("digit");
 }
 if (firstDigit!='0') {
  while (readDigit()) {
  }
 }
 readFraction();
 readExponent();
 return new JsonNumber(Double.parseDouble(endCapture()));
}
org.hjsonJsonNumber

Most used methods

  • <init>

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • notifyDataSetChanged (ArrayAdapter)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • 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