Esempio n. 1
0
 @Override
 public BXElem getDocumentElement() {
   final BXNList list = getChildNodes();
   for (int l = 0; l < list.getLength(); ++l) {
     final BXNode n = list.item(l);
     if (n.getNodeType() == Node.ELEMENT_NODE) return (BXElem) n;
   }
   throw Util.notExpected();
 }
Esempio n. 2
0
 /**
  * Returns a string representation of all found arguments.
  *
  * @param args array with arguments
  * @return string representation
  */
 static String foundArgs(final Value[] args) {
   // compose found arguments
   final StringBuilder sb = new StringBuilder();
   for (final Value v : args) {
     if (sb.length() != 0) sb.append(", ");
     sb.append(v instanceof Jav ? Util.className(((Jav) v).toJava()) : v.seqType());
   }
   return sb.toString();
 }
Esempio n. 3
0
  public static JobSummary fromDom(Element element) {
    JobSummary summary = new JobSummary();
    try {
      summary.numRunningJobs = Util.getChildContentInt(element, "NumRunningJobs");
    } catch (NullPointerException e) {
    }
    try {
      summary.numWaitingJobs = Util.getChildContentInt(element, "NumWaitingJobs");
    } catch (NullPointerException e) {
    }
    try {
      summary.usedProcessors = Util.getChildContentInt(element, "UsedProcessors");
    } catch (NullPointerException e) {
    }

    if ((summary.numRunningJobs == -1)
        && (summary.numWaitingJobs == -1)
        && (summary.usedProcessors == -1)) {
      return null;
    } else {
      return summary;
    }
  }