congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JSONArray.getJSONObject
Code IndexAdd Tabnine to your IDE (free)

How to use
getJSONObject
method
in
us.monoid.json.JSONArray

Best Java code snippets using us.monoid.json.JSONArray.getJSONObject (Showing top 4 results out of 315)

origin: jpasqua/TeslaClient

public List<Vehicle> queryVehicles() {
  List<Vehicle> list = new ArrayList<>(2);
  try {
    JSONResource r = api.json(apiEndpoint("vehicles"));
    JSONArray rawVehicleData = r.object().getJSONArray("response");
    int numVehicles = rawVehicleData.length();
    for (int i = 0; i < numVehicles; i++) {
      Vehicle vehicle = new Vehicle(this, rawVehicleData.getJSONObject(i));
      list.add(vehicle);
    }
  } catch (IOException | JSONException ex) {
    logger.warning("Problem fetching vehicle list: " + ex);
  }
  return list;
}
origin: jpasqua/TeslaClient

JSONObject cur = vals.getJSONObject(i);
double elevation = cur.optDouble("elevation");
double resolution = cur.optDouble("resolution");
origin: org.ihtsdo.otf.common/otf-common

private JSONObject getLatestClassificationObjectOnBranch(String branchPath) throws RestClientException {
  final String classificationsUrl = urlHelper.getClassificationsUrl(branchPath);
  try {
    final JSONArray items = getItems(classificationsUrl);
    if (items != null && items.length() > 0) {
      return items.getJSONObject(items.length() - 1);
    }
    return null;
  } catch (Exception e) {
    throw new RestClientException("Failed to retrieve list of classifications.", e);
  }
}
origin: org.corejet/jira-story-repository

JSONArray issues = (JSONArray)searchResponse.get("issues");
for (int i = 0; i < issues.length() ; i++) {
  JSONObject issue = issues.getJSONObject(i);
  Story story = new Story();
  story.setId(getStringSafe(issue,"key"));
    JSONArray versions = issue.getJSONArray("fixVersions");
    epicAsString = versions.getJSONObject(0).getString("name");
    for(int j = 0; j < versions.length() ; j++){
      JSONObject version = versions.getJSONObject(j);
      if (version.getString("name").toLowerCase().contains("iteration")){
        epicAsString = version.getString("name");
us.monoid.jsonJSONArraygetJSONObject

Javadoc

Get the JSONObject associated with an index.

Popular methods of JSONArray

  • length
    Get the number of elements in the JSONArray, included nulls.
  • get
    Get the object value associated with an index.
  • getString
    Get the string associated with an index.
  • toString
    Make a prettyprinted JSON text of this JSONArray. Warning: This method assumes that the data structu
  • <init>
    Construct a JSONArray from a JSONTokener.
  • getBoolean
    Get the boolean value associated with an index. The string values "true" and "false" are converted t
  • getDouble
    Get the double value associated with an index.
  • getInt
    Get the int value associated with an index.
  • getLong
    Get the long value associated with an index.
  • join
    Make a string from the contents of this JSONArray. Theseparator string is inserted between each elem
  • opt
    Get the optional object value associated with an index.
  • optBoolean
    Get the optional boolean value associated with an index. It returns the defaultValue if there is no
  • opt,
  • optBoolean,
  • optDouble,
  • optInt,
  • optJSONObject,
  • optLong,
  • optString,
  • put,
  • toJSONObject

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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