List of utility methods to do Collection Create
float[] | createFloatArray(java.util.Collection create Float Array final int N = collection.size(); float[] rv = new float[N]; int i = 0; for (Float v : collection) { rv[i++] = v; return rv; |
Collection | createInstance(Class create Instance return (Collection<E>) collectionType.newInstance();
|
int[] | createIntArray(Collection create Int Array int[] array = new int[collection.size()]; int i = 0; for (Integer itereger : collection) { array[i++] = itereger; return array; |
String | createIntegerInClause(Collection p_integers) create in clause of integers. StringBuffer sf = new StringBuffer(); sf.append("("); for (Iterator it = p_integers.iterator(); it.hasNext();) { Number id = (Number) it.next(); sf.append(id.longValue()); if (it.hasNext()) { sf.append(", "); sf.append(")"); return sf.toString(); |
String | createNamedInsert(String tableName, Collection Create an insert SQL string for the table with the specified insert columns. StringBuilder names = new StringBuilder(); StringBuilder values = new StringBuilder(); Iterator<String> it = columnNames.iterator(); while (it.hasNext()) { final String columnName = it.next(); names.append(columnName); values.append(':').append(columnName); if (it.hasNext()) { ... |
String | createNewValue(String value, Collection create New Value if (!values.contains(value)) { return value; for (int i = 2;; i++) { String newValue = value + "_" + i; if (!values.contains(newValue)) { return newValue; |
String | createNominalDescription(Collection Create a nominal description from the possible values. StringBuilder buffer = new StringBuilder(); int ind = 0; for (String value : values) { buffer.append(value); if (++ind < values.size()) { buffer.append(','); return buffer.toString(); |
String | createParameterizedWhereClause(Collection> columns) create Parameterized Where Clause StringBuilder builder = new StringBuilder(); builder.append(" WHERE "); Iterator<?> iter = columns.iterator(); while (iter.hasNext()) { Object column = iter.next(); builder.append(column + " = ?"); if (iter.hasNext()) { builder.append(" AND "); ... |
T | createStringCollection(Class create String Collection T result = clazz.newInstance(); for (String element : elements) { result.add(element); return result; |
String | createStringFromCollection(Collection svcInterfaces) create String From Collection if (svcInterfaces == null) { return null; final StringBuffer result = new StringBuffer(); for (final Iterator i = svcInterfaces.iterator(); i.hasNext();) { final String item = (String) i.next(); result.append(item); if (i.hasNext()) { ... |