Examples of KeyValuePair


Examples of fi.luomus.commons.containers.KeyValuePair

  }

  private void addAdditionParameters(String readerName, HTTPFeedReaderClient feedReaderClient) {
    for (String parameterAndValue : config.get(readerName+"_additionalParameters").split("&")) {
      String[] parts = parameterAndValue.split("=");
            feedReaderClient = feedReaderClient.withAdditionalParameter(new KeyValuePair(parts[0], parts[1]));
    }
  }
View Full Code Here

Examples of fi.luomus.commons.containers.KeyValuePair

    Integer individualCountMax = rs.getInt(5);
    Date oldestRecord = getDate(rs.getString(6));
    Date newestRecord = getDate(rs.getString(7));
   
    AggregateResponseEntry entry = new AggregateResponseEntry(
        Utils.list(new KeyValuePair("lat", lat), new KeyValuePair("long", lon)),
        count, individualCountSum, individualCountMax, oldestRecord, newestRecord
    );
    return entry;
  }
View Full Code Here

Examples of fi.luomus.commons.containers.KeyValuePair

    int i = 1;
    List<KeyValuePair> aggregatedFields = new ArrayList<KeyValuePair>();
    for (String fieldName : aggregateBy) {
      String value = rs.getString(i++);
      if (value == null) value = "";
      aggregatedFields.add(new KeyValuePair(fieldName, value));
    }
   
    Integer count = getInt(rs, i++);
    Integer individualCountSum = rs.getInt(i++);
    Integer individualCountMax = rs.getInt(i++);
View Full Code Here

Examples of fi.luomus.commons.containers.KeyValuePair

    @Test
    public void testAdditionalParamsFeed() throws Exception {
        MockHTTPClient httpClient = new MockHTTPClient(FEED_WITH_ENTRIES_XML);
        HTTPFeedReaderClient client = new HTTPFeedReaderClient(httpClient);
        client = client.withAdditionalParameter(new KeyValuePair("foo", "bar"));
        client.getFeedEntriesFromSeq(getMockUri(), 1, 1);

        hasKeyValuePair(new KeyValuePair("foo", "bar"), httpClient.getLastRequest().getURI());
    }
View Full Code Here

Examples of fi.luomus.commons.containers.KeyValuePair

    }
    @Test
    public void testAdditionalParamsSingle() throws Exception {
        MockHTTPClient httpClient = new MockHTTPClient(SINGLE_ENTRY);
        HTTPFeedReaderClient client = new HTTPFeedReaderClient(httpClient);
        client = client.withAdditionalParameter(new KeyValuePair("foo", "bar"));
        client.getFeedDocument(getMockUri());

        hasKeyValuePair(new KeyValuePair("foo", "bar"), httpClient.getLastRequest().getURI());
    }
View Full Code Here

Examples of gvME.KeyValuePair

        Contact pimContact = (Contact) pimBrowser.getSelectedItem();
        String pimName = pimContact.getString(Contact.FORMATTED_NAME, 0);
        String pimNumber = pimContact.getString(Contact.TEL, 0);
        next.setContacting(pimNumber, pimName);
        try {
            settings.addContact(new KeyValuePair(pimNumber, pimName));
        } catch (RecordStoreException ex) {
            Logger.add(getClass().getName(), "getNumFromPIMBrowser", ex.getMessage());
            ex.printStackTrace();
        } catch (IOException ex) {
            Logger.add(getClass().getName(), "getNumFromPIMBrowser", ex.getMessage());
View Full Code Here

Examples of joptsimple.util.KeyValuePair

        }
        return helpOptionPresent;
    }

    void handleLongOptionToken( String candidate, ArgumentList arguments, OptionSet detected ) {
        KeyValuePair optionAndArgument = parseLongOptionWithArgument( candidate );

        if ( !isRecognized( optionAndArgument.key ) )
            throw unrecognizedOption( optionAndArgument.key );

        AbstractOptionSpec<?> optionSpec = specFor( optionAndArgument.key );
View Full Code Here

Examples of macromedia.asc.parser.MetaDataEvaluator.KeyValuePair

            {
                final Object v = iter.next();

                if (v instanceof KeyValuePair)
                {
                    final KeyValuePair pair = (KeyValuePair)v;
                    parameters.append(pair.key)
                              .append("=\"")
                              .append(pair.obj)
                              .append('"');
                }
View Full Code Here

Examples of org.apache.ctakes.ytex.uima.types.KeyValuePair

    JCas jCas = engine.newJCas();
    jCas.setDocumentText(text);
    // create a docKey so we can find the doc
    long key = System.currentTimeMillis();
    DocKey docKey = new DocKey(jCas);
    KeyValuePair kvp = new KeyValuePair(jCas);
    kvp.setKey("instance_id");
    kvp.setValueLong(key);
    FSArray fsa = new FSArray(jCas, 1);
    fsa.set(0, kvp);
    docKey.setKeyValuePairs(fsa);
    docKey.addToIndexes();
    // run the analysis engine
View Full Code Here

Examples of org.apache.hama.commons.util.KeyValuePair

      convertedKey = (WritableComparable) ReflectionUtils.newInstance(
          convertedKeyClass, conf);
      value = new MapWritable();

      readers.get(i).next(convertedKey, value);
      candidates.put(i, new KeyValuePair(convertedKey, value));
    }

    while (readers.size() > 0) {
      convertedKey = (WritableComparable) ReflectionUtils.newInstance(
          convertedKeyClass, conf);
      value = new MapWritable();

      int readerIndex = 0;
      WritableComparable firstKey = null;
      MapWritable rawRecord = null;

      for (Map.Entry<Integer, KeyValuePair<WritableComparable, MapWritable>> keys : candidates
          .entrySet()) {
        if (firstKey == null) {
          readerIndex = keys.getKey();
          firstKey = keys.getValue().getKey();
          rawRecord = (MapWritable) keys.getValue().getValue();
        } else {
          WritableComparable currentKey = keys.getValue().getKey();
          if (firstKey.compareTo(currentKey) > 0) {
            readerIndex = keys.getKey();
            firstKey = currentKey;
            rawRecord = (MapWritable) keys.getValue().getValue();
          }
        }
      }

      for (Map.Entry<Writable, Writable> e : rawRecord.entrySet()) {
        writer.append(e.getKey(), e.getValue());
      }

      candidates.remove(readerIndex);

      if (readers.get(readerIndex).next(convertedKey, value)) {
        candidates.put(readerIndex, new KeyValuePair(convertedKey, value));
      } else {
        readers.get(readerIndex).close();
        readers.remove(readerIndex);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.