Codota Logo
JSONArray.clear
Code IndexAdd Codota to your IDE (free)

How to use
clear
method
in
org.json.simple.JSONArray

Best Java code snippets using org.json.simple.JSONArray.clear (Showing top 4 results out of 315)

  • Common ways to obtain JSONArray
private void myMethod () {
JSONArray j =
  • Codota Iconnew JSONArray()
  • Codota IconJSONObject json;Object object;(JSONArray) json.get(object)
  • Codota IconString s;(JSONArray) JSONValue.parse(s)
  • Smart code suggestions by Codota
}
origin: marcelo-mason/PreciousStones

/**
 * Returns the list of confiscated items, and removes them from the entry
 *
 * @return
 */
public List<ItemStackEntry> returnInventory() {
  List<ItemStackEntry> out = new ArrayList<>();
  for (Object stackEntry : confiscatedInventory) {
    out.add(new ItemStackEntry((JSONObject) stackEntry));
  }
  confiscatedInventory.clear();
  return out;
}
origin: Exslims/MercuryTrade

public void clear() {
  curIndex = 0;
  messages = new String[0];
  JSONParser parser = new JSONParser();
  try {
    JSONObject root = (JSONObject) parser.parse(new FileReader(HISTORY_FILE));
    JSONArray msgsArray = (JSONArray) root.get("messages");
    msgsArray.clear();
    root.replace("messages", msgsArray);
    FileWriter fileWriter = new FileWriter(HISTORY_FILE);
    fileWriter.write(root.toJSONString());
    fileWriter.flush();
    fileWriter.close();
  } catch (Exception e) {
    logger.error("Error during creating history file: ", e);
  }
}
origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.api

public void setEntitlementPolicyId(int entitlementPolicyId){
  if(policyPartials != null){
    policyPartials.clear();
  }else {
    policyPartials = new JSONArray();
  }
  JSONObject entitlementPolicyIdObject = new JSONObject();
  entitlementPolicyIdObject.put(_KEY_POLICY_PARTIAL_ID, entitlementPolicyId);
  policyPartials.add(entitlementPolicyIdObject);
}
origin: marcelo-mason/PreciousStones

JSONArray paymentList = (JSONArray) flags.get(flag);
paymentList.clear();
for (Object flagStr : paymentList) {
  field.getRentingModule().addPayment(new PaymentEntry(flagStr.toString()));
org.json.simpleJSONArrayclear

Popular methods of JSONArray

  • <init>
    Constructs a JSONArray containing the elements of the specified collection, in the order they are re
  • add
  • size
  • get
  • toJSONString
  • iterator
  • addAll
  • isEmpty
  • toString
  • toArray
  • writeJSONString
  • contains
  • writeJSONString,
  • contains,
  • remove,
  • set,
  • forEach,
  • getJsonObject,
  • listIterator,
  • subList

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now