Here you can find the source of getCombinedColumnName(final List
public static String getCombinedColumnName(final List<String> columnNames, final boolean sortByName)
//package com.java2s; /*//from www. ja v a 2s .co m * @(#)$Id$ * * Copyright 2006-2008 Makoto YUI * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Contributors: * Makoto YUI - initial implementation */ import java.util.Collections; import java.util.List; public class Main { public static String getCombinedColumnName(final List<String> columnNames, final boolean sortByName) { final int size = columnNames.size(); if (size == 0) { throw new IllegalArgumentException(); } if (size == 1) { return columnNames.get(0); } if (sortByName) { Collections.sort(columnNames); } final StringBuilder buf = new StringBuilder(32); for (int i = 0; i < size; i++) { if (i != 0) { buf.append('&'); } String name = columnNames.get(i); buf.append(name); } return buf.toString(); } }