Package java.util

Examples of java.util.Iterator


    List lsMessages = getMessages(nb, selector, remove);
    if (lsMessages.size() > 0) {
      cm = new ClientMessages();
    }
    Message message = null;
    Iterator itMessages = lsMessages.iterator();
    while (itMessages.hasNext()) {
      message = (Message) itMessages.next();
      cm.addMessage(message.getFullMessage());
    }
    return cm;
  }
View Full Code Here


      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "Queue.deliverMessages: notRec.getAutoAck() = " + notRec.getAutoAck()
            + ", lsMessages = " + lsMessages);

      Iterator itMessages = lsMessages.iterator();
      while (itMessages.hasNext()) {
        message = (Message) itMessages.next();
        notMsg.addMessage(message.getFullMessage());
        if (!notRec.getAutoAck()) {
          // putting the message in the delivered messages table:
          consumers.put(message.getIdentifier(), notRec.requester);
          contexts.put(message.getIdentifier(),
View Full Code Here

      return;
    }

    // Let senderId to null because we want to explicitly send messages to the queue itself.
    DMQManager dmqManager = new DMQManager(getId(), null);
    Iterator iterator = messages.iterator();
    while (iterator.hasNext()) {
      dmqManager.addDeadMessage((org.objectweb.joram.shared.messages.Message) iterator.next(),
                                MessageErrorConstants.EXPIRED);
    }
    dmqManager.sendToDMQ();
  }
View Full Code Here

        // default values also
        Map properties = node.getNodeProperties();

        addElementProperties(properties );

        Iterator children = node.getChildren().iterator();
        while ( children.hasNext() ) {
            MappingNode child = (MappingNode)children.next();
            loadNode( child );
        }
        writer.writeEndElement();
    }
View Full Code Here

    /**
     * Add a set of properties to an XML node.
     * @throws XMLStreamException
     */
    void addElementProperties(Map properties ) throws XMLStreamException {
        Iterator propNames = MappingNodeConstants.Tags.OUTPUTTER_PROPERTY_TAGS.iterator();
        while ( propNames.hasNext() ) {
            String propName = (String)propNames.next();
            Integer propKey = MappingNodeConstants.getPropertyInteger(propName);
            if ( properties.containsKey(propKey) ) {
                Object value = properties.get(propKey);
                addElementProperty( propName, value );
            }
View Full Code Here

    void addElementProperty(String name, Object value ) throws XMLStreamException {
        if ( value == null ) {
            throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0010", name) ); //$NON-NLS-1$
        }
        if (value instanceof Collection){
            Iterator i = ((Collection)value).iterator();
            while (i.hasNext()) {
              writeElement(name, getXMLText(i.next()));
      }
        } else {
          writeElement(name, getXMLText(value));
        }
    }
View Full Code Here

        Set tickers = getTickers(query);
        if(tickers.size() == 0) {
            throw new TranslatorException(YahooPlugin.Util.getString("YahooExecution.No_tickers")); //$NON-NLS-1$
        }
        String urlAppendChar = YahooPlugin.Util.getString("YahooExecution.URL_APPEND_CHAR"); //$NON-NLS-1$
        Iterator tickerIter = tickers.iterator();
        url.append(tickerIter.next());       
        while(tickerIter.hasNext()) {
            url.append(urlAppendChar);
            url.append(tickerIter.next());
        }
                      
        url.append(YahooPlugin.Util.getString("YahooExecution.URL_END")); //$NON-NLS-1$             
        return url.toString();
    }
View Full Code Here

     * @param select
     * @return
     */
    static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata metadata) throws TranslatorException {
        int[] cols = new int[select.size()];
        Iterator iter = select.iterator();
        for(int i=0; iter.hasNext(); i++) {
            DerivedColumn symbol = (DerivedColumn) iter.next();
            Expression expr = symbol.getExpression();
            if(expr instanceof ColumnReference) {
                Column element = ((ColumnReference)expr).getMetadataObject();
                cols[i] = element.getPosition();
            } else {
View Full Code Here

        //and non-exhaustive searches
        if (regionCount > EXHAUSTIVE_SEARCH_GROUPS) {
            exhaustive = Math.max(2, EXHAUSTIVE_SEARCH_GROUPS - (int)Math.ceil(Math.sqrt((regionCount - EXHAUSTIVE_SEARCH_GROUPS))));
        }
       
        Iterator permIter = perms.generate(exhaustive);
       
        while(permIter.hasNext()) {
            Object[] order = (Object[]) permIter.next();

            double score = region.scoreRegion(order, 0, metadata, capFinder, context);
            if(score < bestSubScore) {
                bestSubScore = score;
                bestSubOrder = order;
View Full Code Here

                                 int[] ndvs,
                                 int[] nnvs,
                                 String[] mins,
                                 String[] maxs) {
       
        Iterator iter = elementObjects.iterator();
        for(int i=0; iter.hasNext(); i++) {
            FakeMetadataObject obj = (FakeMetadataObject) iter.next();
            if(ndvs != null) {
                obj.putProperty(FakeMetadataObject.Props.DISTINCT_VALUES, new Integer(ndvs[i]));
            }
            if(nnvs != null) {
                obj.putProperty(FakeMetadataObject.Props.NULL_VALUES, new Integer(nnvs[i]));
View Full Code Here

TOP

Related Classes of java.util.Iterator

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.