Package jade.util.leap

Examples of jade.util.leap.ArrayList


      logger.log(Logger.FINER, "MulticastMainDetectionListener::serveGetMain(): my platform is \""+myPlatform+"\" while request is for platform \""+platformName+"\" --> Do not reply");
      return null;
    }

    List addresses = manager.getLocalAddresses();
    List responseAddresses = new ArrayList(addresses.size());

    Iterator iter = addresses.iterator();
    TransportAddress addr;
    while (iter.hasNext()) {
      addr = (TransportAddress)iter.next();
      if (proto != null) {
        if (proto.equals(addr.getProto())) {
          responseAddresses.add(addr);
          break;
        }
      } else {
        responseAddresses.add(addr);
      }
    }

    if (responseAddresses.size() < 1) {
      response = errorResponse(MainDetectionManager.PROTO_RESP_NOTFOUND, "Cannot manage protocol "+proto);
    } else {
      response = MainDetectionManager.PROTO_RESP_OK;
      iter = responseAddresses.iterator();
      while (iter.hasNext()) {
        addr = (TransportAddress)iter.next();
        // FIXME use toString()
        //response += addr.toString();
        response += addr.getProto()+MainDetectionManager.PROTO_ADDR_SEPARATOR+addr.getHost()+MainDetectionManager.PROTO_ADDR_SEPARATOR+addr.getPort();
View Full Code Here


    }
    return absAggregateValue;
  }

  public Object internalizeAggregate(String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto) throws OntologyException {
    List l = new ArrayList();
    for (int i = 0; i < abs.size(); i++) {
      Object element = Ontology.internalizeSlotValue(abs.get(i), this, referenceOnto);
      // Check if the element is a Term, a primitive an AID or a List
      Ontology.checkIsTerm(element);
      l.add(element);
    }
    return l;
  }
View Full Code Here

   * @param onto the ontology
   * @return the List
   * @throws OntologyException
   */
  public static List internaliseList(AbsAggregate aggregate, Ontology onto) throws OntologyException {
    List ret = new ArrayList();

    for (int i = 0; i < aggregate.size(); i++) {
      Object element = onto.toObject(aggregate.get(i));
      // Check if the element is a Term, a primitive an AID or a List
      Ontology.checkIsTerm(element);
      ret.add(element);
    }

    return ret;
  }
View Full Code Here

    }
    return absAggregateValue;
  }

  public Object internalizeAggregate(String slotName, AbsAggregate abs, ObjectSchema schema, Ontology referenceOnto) throws OntologyException {
    List l = new ArrayList();
    for (int i = 0; i < abs.size(); i++) {
      Object element = Ontology.internalizeSlotValue(abs.get(i), this, referenceOnto);
      // Check if the element is a Term, a primitive an AID or a List
      Ontology.checkIsTerm(element);
      l.add(element);
    }
    return l;
  }
View Full Code Here

  public List getItems() {
    if (value instanceof List) {
      return (List) value;
    }
    else {
      List l = new ArrayList(1);
      if (value != null) {
        l.add(value);
      }
      return l;
    }
  }
View Full Code Here

      // Restore output parameters
      getOutputParameters(myBehaviour, myParams);
     
      if (myParams == null) {
        // Result cannot be null
        myParams = new ArrayList();
      }
      Result r = new Result(actionExpr, myParams);
      ACLMessage notification = request.createReply();
      try {
        myContentManager.fillContent(notification, r);
View Full Code Here

  protected int checkSessions(ACLMessage reply) {
    int ret = -1;
    if (getLastExitValue() == MsgReceiver.TIMEOUT_EXPIRED && !allResponsesReceived) {
      // Special case 1: Timeout has expired
      // Remove all the sessions for which no response has been received yet
      List sessionsToRemove = new ArrayList(sessions.size());
      for (Iterator i=sessions.keySet().iterator(); i.hasNext(); ) {
        Object key = i.next();
        Session s = (Session)sessions.get(key);
        if ( s.getState() == Session.INIT ) {
          sessionsToRemove.add(key);
        }
      }
      for (Iterator i=sessionsToRemove.iterator(); i.hasNext(); ) {
        sessions.remove(i.next());
      }
      sessionsToRemove=null//frees memory
    }
    else if (reply == null) {
View Full Code Here

    int ret = -1;
    if (getLastExitValue() == MsgReceiver.TIMEOUT_EXPIRED) {
      if (!allResponsesReceived) {
        // Special case 1: Timeout has expired
        // Remove all the sessions for which no response has been received yet
        List sessionsToRemove = new ArrayList(sessions.size());
        for (Iterator i=sessions.keySet().iterator(); i.hasNext(); ) {
          Object key = i.next();
          Session s = (Session)sessions.get(key);
          if ( s.getState() == Session.INIT ) {
            sessionsToRemove.add(key);
          }
        }
        for (Iterator i=sessionsToRemove.iterator(); i.hasNext(); ) {
          sessions.remove(i.next());
        }
        sessionsToRemove=null//frees memory
      }
      else {
View Full Code Here

    int ret = -1;
    if (getLastExitValue() == MsgReceiver.TIMEOUT_EXPIRED) {
      if (!allResponsesReceived) {
        // Special case 1: Timeout has expired
        // Remove all the sessions for which no response has been received yet
        List sessionsToRemove = new ArrayList(sessions.size());
        for (Iterator i=sessions.keySet().iterator(); i.hasNext(); ) {
          Object key = i.next();
          Session s = (Session)sessions.get(key);
          if ( s.getState() == Session.INIT ) {
            sessionsToRemove.add(key);
          }
        }
        for (Iterator i=sessionsToRemove.iterator(); i.hasNext(); ) {
          sessions.remove(i.next());
        }
        sessionsToRemove=null//frees memory
      }
      else {
View Full Code Here

TOP

Related Classes of jade.util.leap.ArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.