Tabnine Logo
JSONArray.clear
Code IndexAdd Tabnine 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)

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>
  • add
  • size
  • get
  • toJSONString
    Convert a list to JSON text. The result is a JSON array. If this list is also a JSONAware, JSONAware
  • iterator
  • addAll
  • isEmpty
  • toString
  • toArray
  • writeJSONString
    Encode a list into JSON text and write it to out. If this list is also a JSONStreamAware or a JSONAw
  • contains
  • writeJSONString,
  • contains,
  • remove,
  • set,
  • forEach,
  • getJsonObject,
  • listIterator,
  • subList

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JCheckBox (javax.swing)
  • JList (javax.swing)
  • Top plugins for Android Studio
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