Java Utililty Methods List Create

List of utility methods to do List Create

Description

The list of methods to do List Create are organized into topic(s).

Method

StringcreateColumnsToken(List columnnames)
create Columns Token
if (columnnames == null | columnnames.isEmpty()) {
    return "";
StringBuilder sb = new StringBuilder();
for (String colname : columnnames) {
    sb.append(colname);
    sb.append(",");
sb.deleteCharAt(sb.length() - 1);
return sb.toString();
StringcreateCommaList(List values, int rowCharacterCount)
Gets the comma list for given values.
StringBuffer lSB = new StringBuffer();
StringBuffer lRowSB = new StringBuffer();
int liValuesCount = values.size();
int li = 0;
for (Object lValue : values) {
    lRowSB.append(lValue.toString());
    if (li < liValuesCount - 1) {
        lRowSB.append(", ");
...
StringcreateCommand(LinkedList> list)
create Command
StringBuffer command = new StringBuffer();
Iterator<SimpleEntry<String, String>> iter = list.iterator();
while (iter.hasNext()) {
    SimpleEntry<String, String> entry = iter.next();
    command.append(entry.getKey());
    command.append(CMD_KV_SEP);
    command.append(entry.getValue());
    if (iter.hasNext()) {
...
StringcreateConflictMessage(List conflicts)
create Conflict Message
StringBuilder sb = new StringBuilder("merge conflict(s)");
for (String c : conflicts) {
    sb.append('\n' + c);
return sb.toString();
double[][]createConfusionMatrix(HashMap> tempM, List actualLabelsList, List predictedLabelsList)
Creates a confusion matrix by collecting the results from the overall CV run stored in tempM
double[][] matrix = new double[actualLabelsList.size()][predictedLabelsList.size()];
Iterator<String> actualsIter = tempM.keySet().iterator();
while (actualsIter.hasNext()) {
    String actual = actualsIter.next();
    Iterator<String> predsIter = tempM.get(actual).keySet().iterator();
    while (predsIter.hasNext()) {
        String pred = predsIter.next();
        int a = actualLabelsList.indexOf(actual);
...
Map>createConsultInfoMap(List resAry)
create Consult Info Map
Iterator<String> iter = resAry.iterator();
iter.next(); 
iter.next(); 
Map<String, Map<String, String>> resMap = new HashMap<String, Map<String, String>>();
resMap.put("inpatient_urgencies", createMap(iter));
resMap.put("outpatient_urgencies", createMap(iter));
resMap.put("inpatient_places", createMap(iter));
resMap.put("outpatient_places", createMap(iter));
...
StringcreateCSVLine(final char textQ, final char fieldD, final List values)
Create a CSV line based on the values provided.
StringBuilder bld = new StringBuilder();
boolean first = true;
for (Object o : values) {
    if (first) {
        first = false;
    } else {
        bld.append(fieldD);
    if (o instanceof String) {
        bld.append(textQ);
    bld.append(o);
    if (o instanceof String) {
        bld.append(textQ);
return bld.toString();
voidcreateDefaultGroup(String name, String prefabGroup, List nodes)
Creates a default group for all machines to use.
if (name != null) {
    groupDefaultNodes.put(name, nodes);
    groupDefaultExtends.put(name, prefabGroup);
ListcreateDefaultValueList(int capacity, T defaultValue)
creates a list containing the defaultValue as each entry.
List<T> list = new ArrayList<T>(capacity);
for (int i = 0; i < capacity; i++) {
    list.add(defaultValue);
return list;
StringcreateDelimitedString(String rawListAsString)
create Delimited String
return createDelimitedString(rawListAsString, null);