Java Collection Element Get getDocIdString(Collection docIds)

Here you can find the source of getDocIdString(Collection docIds)

Description

Decodes the encoded document IDs and returns the comma-separated String of quoted document IDs.

License

Apache License

Parameter

Parameter Description
docIds a parameter

Return

comma separated list of doc ids.

Declaration

public static String getDocIdString(Collection<String> docIds) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.util.Collection;

public class Main {
    /**/*from ww  w.  j ava2  s. c o m*/
     * Decodes the encoded document IDs and returns the comma-separated
     * String of quoted document IDs.
     *
     * @param docIds
     * @return comma separated list of doc ids.
     */
    public static String getDocIdString(Collection<String> docIds) {
        StringBuilder docIdString = new StringBuilder("");
        // TODO(bmj): This should be fixed for numeric primary keys.
        // Enclosing them in quotes is a SQL syntax error.
        for (String docId : docIds) {
            docIdString.append("'" + docId + "'" + ",");
        }
        return docIdString.substring(0, docIdString.length() - 1);
    }
}

Related

  1. getCommaSeparatedStringFromCollection(Collection collections)
  2. getCommon(Collection c1, Collection c2)
  3. getCommonElements( Collection from, Collection to)
  4. getCommonSuffix(Collection c)
  5. getComponentName(Collection existingNames, String name)
  6. getElement(final int index, final Collection coll)
  7. getElementClass(Collection collection)
  8. getElementFromSize1(Collection collection)
  9. getEntropy(Collection values)