Java Code Examples for org.json.JSONObject#getDouble()

The following examples show how to use org.json.JSONObject#getDouble() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: XQuickEnergy   File: AntFarm.java    License: Apache License 2.0 6 votes vote down vote up
private static void recallAnimal(ClassLoader loader, String animalId, String currentFarmId, String masterFarmId, String user)
{
 try
 {
  String s = AntFarmRpcCall.rpcCall_recallAnimal(loader, animalId, currentFarmId, masterFarmId);
  JSONObject jo = new JSONObject(s);
  String memo = jo.getString("memo");
  if(memo.equals("SUCCESS"))
  {
   double foodHaveStolen = jo.getDouble("foodHaveStolen");
   Log.farm("召回小鸡,偷吃〔" + user + "〕〔" + foodHaveStolen + "克〕");
   // 这里不需要加
   // add2FoodStock((int)foodHaveStolen);
  }else
  {
   Log.recordLog(memo, s);
  }
 }catch(Throwable t)
 {
  Log.i(TAG, "recallAnimal err:");
  Log.printStackTrace(TAG, t);
 }
}
 
Example 2
@Override
public void fromJSON(JSONObject jsonObject)
        throws JSONException
{
    super.fromJSON(jsonObject);
    if (jsonObject.has(JSON_MAXLEVEL_KEY)) {
        mMaxZoom = (float) jsonObject.getDouble(JSON_MAXLEVEL_KEY);
    } else {
        mMaxZoom = GeoConstants.DEFAULT_MAX_ZOOM;
    }
    if (jsonObject.has(JSON_MINLEVEL_KEY)) {
        mMinZoom = (float) jsonObject.getDouble(JSON_MINLEVEL_KEY);
    } else {
        mMinZoom = GeoConstants.DEFAULT_MIN_ZOOM;
    }

    mIsVisible = jsonObject.getBoolean(JSON_VISIBILITY_KEY);

    if(Constants.DEBUG_MODE){
        Log.d(Constants.TAG, "Layer " + getName() + " is visible " + mIsVisible);
        Log.d(Constants.TAG, "Layer " + getName() + " zoom limits from " + mMinZoom + " to " + mMaxZoom);
    }
}
 
Example 3
/**
 * Takes the complete JSON object of currency data and extracts each currency
 * field, price and date, and puts them into a HashMap of Entries to return
 * @param rawJson is the complete JSON object of currency data
 * @return a HashMap of Entries
 * @throws JSONException if JSON object's key doesn't return valid data
 */
private HashMap<String, Entry> jsonToHashMap(JSONObject rawJson) throws JSONException {
	HashMap<String, Entry> entries = new HashMap<>();

	for (Iterator<String> it = rawJson.keys(); it.hasNext(); ) {
		String key = it.next();
		JSONObject currency = rawJson.getJSONObject(key);
		String name = currency.getString("code");
		double rate = currency.getDouble("rate");
		Date date = parseDate(currency.getString("date"));

		Entry entry = new Entry(rate, name, date);
		entries.put(name, entry);
	}
	return entries;
}
 
Example 4
/**
 * @see IDataExtractor#extractRadiusSearchItemData(String)
 */
@Override
public RadiusSearchItem extractRadiusSearchItemData(String data) {
    try {
        JSONObject jsonData = new JSONObject(data);
        JSONObject jsonMain = jsonData.getJSONObject("main");
        JSONArray jsonWeatherArray = jsonData.getJSONArray("weather");
        JSONObject jsonWeather = new JSONObject(jsonWeatherArray.get(0).toString());
        IApiToDatabaseConversion conversion = new OwmToDatabaseConversion();

        return new RadiusSearchItem(
                jsonData.getString("name"),
                (float) jsonMain.getDouble("temp"),
                conversion.convertWeatherCategory(jsonWeather.getString("id"))
        );
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return null;
}
 
Example 5
Source Project: json2view   File: DynamicHelper.java    License: MIT License 6 votes vote down vote up
private static Object getFromJSON(JSONObject json, String name, Class clazz) throws JSONException {
    if ((clazz == Integer.class)||(clazz == Integer.TYPE)) {
        return json.getInt(name);
    } else if ((clazz == Boolean.class)||(clazz == Boolean.TYPE)) {
        return json.getBoolean(name);
    } else if ((clazz == Double.class)||(clazz == Double.TYPE)) {
        return json.getDouble(name);
    } else if ((clazz == Float.class)||(clazz == Float.TYPE)) {
        return (float)json.getDouble(name);
    } else if ((clazz == Long.class)||(clazz == Long.TYPE)) {
        return json.getLong(name);
    } else if (clazz == String.class) {
        return json.getString(name);
    } else if (clazz == JSONObject.class) {
        return json.getJSONObject(name);
    } else {
        return json.get(name);

    }
}
 
Example 6
Source Project: codenjoy   File: Board.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public ClientBoard forString(String boardString) {
    source = new JSONObject(boardString);

    Level = source.getInt("level");
    Time = source.getDouble("time");
    X = source.getDouble("x");
    Y = source.getDouble("y");
    HSpeed = source.getDouble("hspeed");
    VSpeed = source.getDouble("vspeed");
    FuelMass = source.getDouble("fuelmass");
    State = source.getString("state");
    Angle = source.getDouble("angle");
    Target = getPoint(source, "target");
    Relief = getPointList(source, "relief");
    History = getPointList(source, "history");

    return this;
}
 
Example 7
Source Project: AndroidChromium   File: CastSessionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandleVolumeMessageResult handleVolumeMessage(
        JSONObject volume, final String clientId, final int sequenceNumber)
        throws JSONException {
    if (volume == null) return new HandleVolumeMessageResult(false, false);

    if (isApiClientInvalid()) return new HandleVolumeMessageResult(false, false);

    boolean waitForVolumeChange = false;
    try {
        if (!volume.isNull("muted")) {
            boolean newMuted = volume.getBoolean("muted");
            if (Cast.CastApi.isMute(mApiClient) != newMuted) {
                Cast.CastApi.setMute(mApiClient, newMuted);
                waitForVolumeChange = true;
            }
        }
        if (!volume.isNull("level")) {
            double newLevel = volume.getDouble("level");
            double currentLevel = Cast.CastApi.getVolume(mApiClient);
            if (!Double.isNaN(currentLevel)
                    && Math.abs(currentLevel - newLevel) > MIN_VOLUME_LEVEL_DELTA) {
                Cast.CastApi.setVolume(mApiClient, newLevel);
                waitForVolumeChange = true;
            }
        }
    } catch (IOException e) {
        Log.e(TAG, "Failed to send volume command: " + e);
        return new HandleVolumeMessageResult(false, false);
    }

    return new HandleVolumeMessageResult(true, waitForVolumeChange);
}
 
Example 8
Source Project: SprintNBA   File: JSONUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 获取json里面的某个Double类型的值
 *
 * @param jsonObject
 * @param key
 * @param defaultValue
 * @return
 */
public static Double getDouble(JSONObject jsonObject, String key, Double defaultValue) {
    if (jsonObject == null || StringUtils.isEmpty(key)) {
        return defaultValue;
    }

    try {
        return jsonObject.getDouble(key);
    } catch (JSONException e) {
        if (isPrintException) {
            e.printStackTrace();
        }
        return defaultValue;
    }
}
 
Example 9
Source Project: barefoot   File: StateCandidate.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates {@link StateCandidate} object from its JSON representation.
 *
 * @param json JSON representation of an {@link StateCandidate} object.
 * @param factory {@link Factory} object for construction of state candidates and transitions.
 * @throws JSONException thrown on JSON extraction or parsing error.
 */
public StateCandidate(JSONObject json, Factory<C, T, S> factory) throws JSONException {
    id = json.getString("id");
    JSONObject jsontrans = json.optJSONObject("transition");
    if (jsontrans != null) {
        transition = factory.transition(jsontrans);
    }

    // This does not handle infinite values.
    filtprob = json.getDouble("filtprob");
    seqprob = json.getDouble("seqprob");
}
 
Example 10
@Override
public void fromJSON(JSONObject jsonObject) throws JSONException {
    super.fromJSON(jsonObject);
    if (jsonObject.has(JSON_WIDTH_KEY)) {
        mWidth = (float) jsonObject.getDouble(JSON_WIDTH_KEY);
    }
    if (jsonObject.has(JSON_FILL_KEY)) {
        mFill = jsonObject.getBoolean(JSON_FILL_KEY);
    }
}
 
Example 11
Source Project: rheem   File: LoadEstimate.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
public static LoadEstimate fromJson(JSONObject jsonObject) {
    return new LoadEstimate(
            jsonObject.getLong("lower"),
            jsonObject.getLong("upper"),
            jsonObject.getDouble("prob")
    );
}
 
Example 12
public double getLng() throws EvercamException {
    if (jsonObject.isNull("location")) {
        return 0.0;
    } else {
        JSONObject locationJsonObject = getJsonObjectByString("location");
        try {
            return (float) locationJsonObject.getDouble("lng");
        } catch (JSONException e) {
            throw new EvercamException(e);
        }
    }
}
 
Example 13
Source Project: browser   File: JSONUtil.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static double getDouble(JSONObject docObj, String name) {
	double ret = 0;

	if (docObj.has(name)) {
		try {
			ret = docObj.getDouble(name);
		} catch (JSONException e) {

		}
	}

	return ret;
}
 
Example 14
Source Project: product-ei   File: ProcessLevelMonitor.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * perform query: SELECT processDefinitionId, AVG(duration) AS avgExecutionTime FROM
 *                PROCESS_USAGE_SUMMARY WHERE <date range> GROUP BY processDefinitionId;
 *
 * @param filters is a given date range represents as the JSON string
 * @return the result as a JSON string
 */
public String getAvgExecuteTimeVsProcessId(String filters) {
	String sortedResult = "";
	try {
		if (BPMNAnalyticsCoreUtils.isDASAnalyticsActivated()) {
			JSONObject filterObj = new JSONObject(filters);
			long from = filterObj.getLong(BPMNAnalyticsCoreConstants.START_TIME);
			long to = filterObj.getLong(BPMNAnalyticsCoreConstants.END_TIME);
			String order = filterObj.getString(BPMNAnalyticsCoreConstants.ORDER);
			int processCount = filterObj.getInt(BPMNAnalyticsCoreConstants.NUM_COUNT);

			AggregateField avgField = new AggregateField();
			avgField.setFieldName(BPMNAnalyticsCoreConstants.DURATION);
			avgField.setAggregate(BPMNAnalyticsCoreConstants.AVG);
			avgField.setAlias(BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME);

			ArrayList<AggregateField> aggregateFields = new ArrayList<>();
			aggregateFields.add(avgField);

			AggregateQuery query = new AggregateQuery();
			query.setTableName(BPMNAnalyticsCoreConstants.PROCESS_USAGE_TABLE);
			query.setGroupByField(BPMNAnalyticsCoreConstants.PROCESS_DEFINITION_KEY);
			if (from != 0 && to != 0) {
				query.setQuery(BPMNAnalyticsCoreUtils.getDateRangeQuery(
						BPMNAnalyticsCoreConstants.COLUMN_FINISHED_TIME, from, to));
			}
			query.setAggregateFields(aggregateFields);

			if (log.isDebugEnabled()) {
				log.debug("Query to get Avg Execution Time Vs ProcessId Result:" +
				          BPMNAnalyticsCoreUtils.getJSONString(query));
			}

			String result = BPMNAnalyticsCoreRestClient
					.post(BPMNAnalyticsCoreUtils.getURL(BPMNAnalyticsCoreConstants.ANALYTICS_AGGREGATE),
					      BPMNAnalyticsCoreUtils.getJSONString(query));

			JSONArray unsortedResultArray = new JSONArray(result);
			Hashtable<String, Double> table = new Hashtable<>();

			if (unsortedResultArray.length() != 0) {
				for (int i = 0; i < unsortedResultArray.length(); i++) {
					JSONObject jsonObj = unsortedResultArray.getJSONObject(i);
					JSONObject values = jsonObj.getJSONObject(BPMNAnalyticsCoreConstants.VALUES);
					String processDefKey =
							values.getJSONArray(BPMNAnalyticsCoreConstants.PROCESS_DEFINITION_KEY)
							      .getString(0);
					double avgExecTime =
							values.getDouble(BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME);
					table.put(processDefKey, avgExecTime);
				}
				sortedResult = BPMNAnalyticsCoreUtils.getDoubleValueSortedList(table,
				                                                               BPMNAnalyticsCoreConstants.PROCESS_DEFINITION_KEY,
				                                                               BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME,
				                                                               order,
				                                                               processCount);
			}
		}
	} catch (JSONException | XMLStreamException | IOException e) {
		log.error("BPMN Analytics Core - Avg Execution Time Vs ProcessId ProcessLevelMonitoring error.", e);
	}
	if (log.isDebugEnabled()) {
		log.debug("Avg Execution Time Vs ProcessId Result:" + sortedResult);
	}
	return sortedResult;
}
 
Example 15
Source Project: mirror   File: Weather.java    License: MIT License 4 votes vote down vote up
/**
 * Reads the current temperature from the API response. API documentation:
 * https://darksky.net/dev/docs
 */
private Double parseCurrentTemperature(JSONObject response) throws JSONException {
  JSONObject currently = response.getJSONObject("currently");
  return currently.getDouble("temperature");
}
 
Example 16
@Keep
public void dispatchStatusEventAsync(String msg,String type) {
    Event event = null;
    switch (type){
        case Event.TRACE:
            event = new Event(Event.TRACE,msg);
            break;
        case Event.INFO:
            event = new Event(Event.INFO,msg);
            break;
        case Event.INFO_HTML:
            event = new Event(Event.INFO_HTML,msg);
            break;
        case Event.ON_PROBE_INFO:
            event = new Event(Event.ON_PROBE_INFO,msg);
            break;
        case Event.ON_PROBE_INFO_AVAILABLE:
            event = new Event(Event.ON_PROBE_INFO_AVAILABLE,msg);
            break;
        case Event.NO_PROBE_INFO:
            event = new Event(Event.NO_PROBE_INFO,msg);
            break;
        case Event.ON_ENCODE_START:
            Log.i("Event.ON_ENCODE_START",msg);
            event = new Event(Event.ON_ENCODE_START,msg);
            break;
        case Event.ON_ENCODE_FINISH:
            event = new Event(Event.ON_ENCODE_FINISH,msg);
            break;
        case Event.ON_ENCODE_ERROR:
            event = new Event(Event.ON_ENCODE_ERROR,msg);
            break;
        case Event.ON_ERROR_MESSAGE:
            event = new Event(Event.ON_ERROR_MESSAGE,msg);
            break;
        case Event.ON_ENCODE_PROGRESS:

            try {
                jsonObject = new JSONObject(msg);
                progress.bitrate = jsonObject.getDouble("bitrate");
                progress.fps = jsonObject.getDouble("fps");
                progress.frame = jsonObject.getInt("frame");
                progress.secs = jsonObject.getInt("secs");
                progress.size = jsonObject.getDouble("size");
                progress.speed = jsonObject.getDouble("speed");
                progress.us = jsonObject.getInt("us");
                event = new Event(Event.ON_ENCODE_PROGRESS,progress);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            break;

        default:
            break;
    }
    if(event != null)
        dispatchEvent(event);

    //Log.i("JniHandler message",msg);
    //Log.i("JniHandler type",type);

    //StatusObject obj = new StatusObject();
    //obj.type = type;
    //obj.message = msg;
    //Event event = new Event(Event.STATUS,obj);
    //dispatchEvent(event);

}
 
Example 17
/**
 * This method parses JSON from a web response and returns an array of Strings
 * describing the weather over various days from the forecast.
 * <p/>
 * Later on, we'll be parsing the JSON into structured data within the
 * getFullWeatherDataFromJson function, leveraging the data we have stored in the JSON. For
 * now, we just convert the JSON into human-readable strings.
 *
 * @param forecastJsonStr JSON response from server
 *
 * @return Array of Strings describing weather data
 *
 * @throws JSONException If JSON data cannot be properly parsed
 */
public static String[] getSimpleWeatherStringsFromJson(Context context, String forecastJsonStr)
        throws JSONException {

    String[] parsedWeatherData;

    JSONObject forecastJson = new JSONObject(forecastJsonStr);

    /* Is there an error? */
    if (forecastJson.has(OWM_MESSAGE_CODE)) {
        int errorCode = forecastJson.getInt(OWM_MESSAGE_CODE);

        switch (errorCode) {
            case HttpURLConnection.HTTP_OK:
                break;
            case HttpURLConnection.HTTP_NOT_FOUND:
                /* Location invalid */
                return null;
            default:
                /* Server probably down */
                return null;
        }
    }

    JSONArray weatherArray = forecastJson.getJSONArray(OWM_LIST);

    parsedWeatherData = new String[weatherArray.length()];

    long startDay = SunshineDateUtils.getNormalizedUtcDateForToday();

    for (int i = 0; i < weatherArray.length(); i++) {
        String date;
        String highAndLow;

        /* These are the values that will be collected */
        long dateTimeMillis;
        double high;
        double low;

        int weatherId;
        String description;

        /* Get the JSON object representing the day */
        JSONObject dayForecast = weatherArray.getJSONObject(i);

        /*
         * We ignore all the datetime values embedded in the JSON and assume that
         * the values are returned in-order by day (which is not guaranteed to be correct).
         */
        dateTimeMillis = startDay + SunshineDateUtils.DAY_IN_MILLIS * i;
        date = SunshineDateUtils.getFriendlyDateString(context, dateTimeMillis, false);

        /*
         * Description is in a child array called "weather", which is 1 element long.
         * That element also contains a weather code.
         */
        JSONObject weatherObject =
                dayForecast.getJSONArray(OWM_WEATHER).getJSONObject(0);

        weatherId = weatherObject.getInt(OWM_WEATHER_ID);
        description = SunshineWeatherUtils.getStringForWeatherCondition(context, weatherId);

        /*
         * Temperatures are sent by Open Weather Map in a child object called "temp".
         *
         * Editor's Note: Try not to name variables "temp" when working with temperature.
         * It confuses everybody. Temp could easily mean any number of things, including
         * temperature, temporary and is just a bad variable name.
         */
        JSONObject temperatureObject = dayForecast.getJSONObject(OWM_TEMPERATURE);
        high = temperatureObject.getDouble(OWM_MAX);
        low = temperatureObject.getDouble(OWM_MIN);
        highAndLow = SunshineWeatherUtils.formatHighLows(context, high, low);

        parsedWeatherData[i] = date + " - " + description + " - " + highAndLow;
    }

    return parsedWeatherData;
}
 
Example 18
public void setFromJson( String json ) throws Exception {
    JSONObject jobj = new JSONObject(json);

    // note that getDouble is used to have android compatibility (do not use getFloat)
    id = jobj.getLong(ID);
    if (jobj.has(NAME))
        name = jobj.getString(NAME);
    if (jobj.has(SIZE))
        size = jobj.getDouble(SIZE);
    if (jobj.has(FILLCOLOR))
        fillcolor = jobj.getString(FILLCOLOR);
    if (jobj.has(STROKECOLOR))
        strokecolor = jobj.getString(STROKECOLOR);
    if (jobj.has(FILLALPHA))
        fillalpha = jobj.getDouble(FILLALPHA);
    if (jobj.has(STROKEALPHA))
        strokealpha = jobj.getDouble(STROKEALPHA);
    if (jobj.has(SHAPE))
        shape = jobj.getString(SHAPE);
    if (jobj.has(WIDTH))
        width = jobj.getDouble(WIDTH);
    if (jobj.has(LABELSIZE))
        labelsize = jobj.getDouble(LABELSIZE);
    if (jobj.has(LABELFIELD))
        labelfield = jobj.getString(LABELFIELD);
    if (jobj.has(LABELVISIBLE))
        labelvisible = jobj.getInt(LABELVISIBLE);
    if (jobj.has(ENABLED))
        enabled = jobj.getInt(ENABLED);
    if (jobj.has(ORDER))
        order = jobj.getInt(ORDER);
    if (jobj.has(DASH))
        dashPattern = jobj.getString(DASH);
    if (jobj.has(MINZOOM))
        minZoom = jobj.getInt(MINZOOM);
    if (jobj.has(MAXZOOM))
        maxZoom = jobj.getInt(MAXZOOM);
    if (jobj.has(DECIMATION))
        decimationFactor = jobj.getDouble(DECIMATION);

}
 
Example 19
Source Project: product-ei   File: UserLevelMonitor.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * perform query: SELECT taskDefinitionKey, AVG(duration) AS avgExecutionTime FROM
 *                USER_INVOLVE_SUMMARY_DATA WHERE <assignee> GROUP BY taskDefinitionKey;
 *
 * @param filters is used to filter the result
 * @return the result as a JSON string
 */
public String getUserLevelAvgExecuteTimeVsTaskId(String filters) {
	String sortedResult = "";
	try {
		if (BPMNAnalyticsCoreUtils.isDASAnalyticsActivated()) {
			JSONObject filterObj = new JSONObject(filters);
			String processId = filterObj.getString(BPMNAnalyticsCoreConstants.PROCESS_ID);
			String userId = filterObj.getString(BPMNAnalyticsCoreConstants.USER_ID);
			String order = filterObj.getString(BPMNAnalyticsCoreConstants.ORDER);
			int taskCount = filterObj.getInt(BPMNAnalyticsCoreConstants.NUM_COUNT);

			AggregateField avgField = new AggregateField();
			avgField.setFieldName(BPMNAnalyticsCoreConstants.DURATION);
			avgField.setAggregate(BPMNAnalyticsCoreConstants.AVG);
			avgField.setAlias(BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME);

			ArrayList<AggregateField> aggregateFields = new ArrayList<>();
			aggregateFields.add(avgField);

			AggregateQuery query = new AggregateQuery();
			query.setTableName(BPMNAnalyticsCoreConstants.USER_INVOLVE_TABLE);
			query.setGroupByField(BPMNAnalyticsCoreConstants.TASK_DEFINITION_KEY);
			String queryStr="assignee:" + "\"'" + userId + "'\"";
			queryStr += " AND " + "processDefKey:" + "\"'" + processId + "'\"";
			query.setQuery(queryStr);
			query.setAggregateFields(aggregateFields);

			if (log.isDebugEnabled()) {
				log.debug("Query to get User Level Avg Execution Time Vs Task Id Result:" +
				          BPMNAnalyticsCoreUtils.getJSONString(query));
			}

			String result = BPMNAnalyticsCoreRestClient
					.post(BPMNAnalyticsCoreUtils.getURL(BPMNAnalyticsCoreConstants.ANALYTICS_AGGREGATE),
					      BPMNAnalyticsCoreUtils.getJSONString(query));

			JSONArray unsortedResultArray = new JSONArray(result);
			Hashtable<String, Double> table = new Hashtable<>();

			if (unsortedResultArray.length() != 0) {
				for (int i = 0; i < unsortedResultArray.length(); i++) {
					JSONObject jsonObj = unsortedResultArray.getJSONObject(i);
					JSONObject values = jsonObj.getJSONObject(BPMNAnalyticsCoreConstants.VALUES);
					String taskDefKey =
							values.getJSONArray(BPMNAnalyticsCoreConstants.TASK_DEFINITION_KEY)
							      .getString(0);
					double avgExecTime =
							values.getDouble(BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME);
					table.put(taskDefKey, avgExecTime);
				}
				sortedResult = BPMNAnalyticsCoreUtils
						.getDoubleValueSortedList(table, BPMNAnalyticsCoreConstants.TASK_DEFINITION_KEY,
						                          BPMNAnalyticsCoreConstants.AVG_EXECUTION_TIME, order,
						                          taskCount);
			}
		}
	} catch (JSONException | IOException | XMLStreamException e) {
		log.error("BPMN Analytics Core - User Level Avg Execution Time Vs Task Id UserLevelMonitoring error.", e);
	}
	if (log.isDebugEnabled()) {
		log.debug("User Level Avg Execution Time Vs Task Id Result:" + sortedResult);
	}
	return sortedResult;
}
 
Example 20
Source Project: rheem   File: CardinalityEstimate.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Parses the given {@link JSONObject} to create a new instance.
 *
 * @param json that should be parsed
 * @return the new instance
 */
public static CardinalityEstimate fromJson(JSONObject json) {
    return new CardinalityEstimate(json.getLong("lowerBound"), json.getLong("upperBound"), json.getDouble("confidence"));
}