/* Everything below this comment: implementation of the list interface
963140
@Override
	public void add(int location, T object)
	{
		list.add(location, object);
		onModification();
	}
772971
public synchronized void returnList(List list) {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "returnList");

        list.clear();
        listPool.add(list);

        if (tc.isEntryEnabled())
            SibTr.exit(tc, "returnList");
    }
414310
private void _serializeList(List list, StringBuilder sb, Set<Object> done) throws ConverterException {

	sb.append(goIn());
	sb.append("[");
	boolean doIt = false;
	ListIterator it = list.listIterator();
	while (it.hasNext()) {
	    if (doIt) sb.append(',');
	    doIt = true;
	    _serialize(it.next(), sb, done);
	}

	sb.append(']');
    }
574428
private static List<Integer> convertList(List<String> list) {
        if (list == null) {
            return null;
        }
        List<Integer> ret = new ArrayList<Integer>(list.size());
        for (String v : list) {
            ret.add(StringUtils.toInt(v));
        }

        return ret;
    }
150839
private void _initListBlock (@Nonnull final Block aRoot)
  {
    Line aLine = aRoot.m_aLines;
    aLine = aLine.m_aNext;
    while (aLine != null)
    {
      final ELineType eType = aLine.getLineType (m_bUseExtensions);
      if (eType == ELineType.OLIST ||
          eType == ELineType.ULIST ||
          (!aLine.m_bIsEmpty &&
           aLine.m_bPrevEmpty &&
           aLine.m_nLeading == 0 &&
           !(eType == ELineType.OLIST || eType == ELineType.ULIST)))
      {
        aRoot.split (aLine.m_aPrevious).m_eType = EBlockType.LIST_ITEM;
      }
      aLine = aLine.m_aNext;
    }
    aRoot.split (aRoot.m_aLineTail).m_eType = EBlockType.LIST_ITEM;
  }
821857
private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
        Iterator it = collection.iterator();
        boolean hasNext = it.hasNext();
        //boolean areColumns = (columns == collection);

        while (hasNext) {
            Outputable sqlToken = (Outputable) it.next();
            hasNext = it.hasNext();
            sqlToken.write(out);
            if (areColumns) {
                Column column = (Column) sqlToken;
                String columnAlias = column.getAlias();
                if (columnAlias != null) {
                    out.print(" AS ");
                    out.print("\"");
                    out.print(columnAlias);
                    out.print("\"");
                }
            }
            if (hasNext) {
                out.print(separator);
                out.println();
            }
        }
    }
1330427
private void init( List<T> list ) {
		this.list = list;
		indexes = new int[ list.size() ];
		counters = new int[ list.size() ];

		for( int i = 0; i < indexes.length ; i++ ) {
			counters[i] = indexes[i] = i;
		}

		total = 1;
		for( int i = 2; i <= indexes.length ; i++ ) {
			total *= i;
		}

		permutation = 0;
	}
482240
private static int[] intListToPrimitiveArray(List<Integer> result)
    {
        int[] resultArray = new int[result.size()];
        int index = 0;

        for (int r : result)
        {
            resultArray[index] = result.get(index);
            index++;
        }

        return resultArray;
    }
1062033
private static void listToWriter(List<?> list, JsonWriter writer) throws IOException {
    writer.beginArray();
    for (Object value : list) {
      writeValue(value, writer);
    }
    writer.endArray();
  }
504759
static void printList(final PrintWriter pw, final List<?> l) {
        for (int i = 0; i < l.size(); ++i) {
            Object o = l.get(i);
            if (o instanceof List) {
                printList(pw, (List<?>) o);
            } else {
                pw.print(o.toString());
            }
        }
    }
1220819
function gotList(thelist) {
  console.log("List of Serial Ports:");
  // theList is an array of their names
  for (var i = 0; i < thelist.length; i++) {
    // Display in the console
    console.log(i + " " + thelist[i]);
  }
}
829850
function(list){
		var type = typeof list;
		if(type === "string" || Array.isArray(list)) {
			return true;
		}
		var length = list && (type !== 'boolean' && type !== 'number' && "length" in list) && list.length;

		// var length = "length" in obj && obj.length;
		return typeof list !== "function" &&
			( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in list );
	}
395723
public void pollAllToList(List<T> retList) {
    while (head != null) {
      retList.add(head.element);
      head = head.after;
    }
    this.clear();
  }
531233
function (list) {
		var items = [];
		var i = 0;
		var listLength = list.length;

		for (; i < listLength; i++) {
			items.push(list[i]);
		}

		return items;
	}
180265
private static void addStringList(CodeBlock.Builder code, List<String> list, String indent) {
    int size = list.size();
    code.add("$T.asList(\n$L", Arrays.class, indent);
    int width = indent.length();
    for (int i = 0; i < size; i++) {
      if (i != 0) {
        code.add(", ");
        width += 2;
      }
      if (width > 80) {
        width = indent.length();
        code.add("\n$L", indent);
      }
      String element = list.get(i);
      code.add("$S", element);
      width += element.length() + 2;
    }
    code.add("\n$L)", indent);
  }
1141038
static boolean equalsImpl(List<?> list, @Nullable Object object) {
    if (object == checkNotNull(list)) {
      return true;
    }
    if (!(object instanceof List)) {
      return false;
    }

    List<?> o = (List<?>) object;

    return list.size() == o.size()
        && Iterators.elementsEqual(list.iterator(), o.iterator());
  }
280500
function processListItems(list_str) {

        listLevel++;

        list_str = list_str.replace(/\n{2,}$/,"\n");
        list_str += "~0";

        list_str = list_str.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, function(wholeMatch,m1,m2,m3,m4){

            var item = m4;
            var leading_line = m1;
            var leading_space = m2;

            if (leading_line || (item.search(/\n{2,}/)>-1)) {
                item = runBlockGamut(outdent(item));
            }
            else {
                item = doLists(outdent(item));
                item = item.replace(/\n$/,"");
                item = runSpanGamut(item);
            }

            return  "<li>" + item + "</li>\n";
        });

        list_str = list_str.replace(/~0/g,"");
        listLevel--;

        return list_str;
    }