Java TreeSet concatenate(TreeSet in)

Here you can find the source of concatenate(TreeSet in)

Description

concatenate

License

Apache License

Declaration

public static String concatenate(TreeSet<String> in) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.TreeSet;

public class Main {
    public static final char CONCATENATION_TOKEN = ' ';
    public static final char CONCATENATION_SUBSTITUTE = '_';

    public static String concatenate(TreeSet<String> in) {
        StringBuffer buffer = new StringBuffer();
        for (String element : in) {
            buffer.append(element.trim().replaceAll(CONCATENATION_TOKEN + "", CONCATENATION_SUBSTITUTE + ""));
            buffer.append(CONCATENATION_TOKEN);
        }//  ww  w  .jav a  2 s. com
        String result = buffer.toString();
        return result;
    }
}

Related

  1. addSplits(TreeSet splitKeys, byte[] prefix, int splitBits)
  2. buildTreeSet(Collection elements)
  3. changeComparator(TreeSet set, Comparator cmp)
  4. convertSpanToSparseGrid(final int curIx, final int span, final TreeSet indexes)
  5. createTreeSet(Iterable c)
  6. cvtListToTreeSet(List list)
  7. findSizedSubdirs(final String size, final TreeSet themeSubdirs)