Compiles a tableswitch, lookupswitch or if/goto depending on contents of
LookupList.
<p>Stack: ..., index =&gt; ...,
@param def
@param list
@throws IOException
329863
public void optimizedSwitch(String def, LookupList list) throws IOException
    {
        if (list.isEmpty())
        {
            throw new IllegalArgumentException("empty lookuplist");
        }
        if (list.size() == 1)
        {
            for (LookupPair lp : list)
            {
                iconst(lp.getMatch());
                if_icmpeq(lp.getTarget());
            }
            goto_n(def);
        }
        else
        {
            if (optimize && list.canOptimize())
            {
                for (LookupPair lp : list)
                {
                    String next = createBranch();
                    dup();
                    iconst(lp.getMatch());
                    if_icmpne(next);
                    pop();
                    goto_n(lp.getTarget());
                    fixAddress(next);
                }
                pop();
                goto_n(def);
            }
            else
            {
                if (list.isContiguous())    // note! list is sorted at this point
                {
                    String[] symbols = new String[list.size()];
                    int index = 0;
                    for (LookupPair lp : list)
                    {
                        symbols[index++] = lp.getTarget();
                    }
                    tableswitch(def, list.get(0).getMatch(), list.get(list.size()-1).getMatch(), symbols);
                }
                else
                {
                    lookupswitch(def, list);
                }
            }
        }
    }
868450
public synchronized void onAddedToList(ObservableList list, Object value) {
        if (!configuration.isUseGc()) {
            return;
        }
        if (value != null && DolphinUtils.isDolphinBean(value.getClass())) {
            Instance instance = getInstance(value);
            Reference reference = new ListReference(listToParent.get(list), list, instance);
            if (reference.hasCircularReference()) {
                throw new CircularDependencyException("Circular dependency detected!");
            }
            instance.getReferences().add(reference);
            removeFromGC(instance);
        }
    }
35595
public static String join(List<String> list) {
    if (list == null) {
      return null;
    }

    StringBuilder joined = new StringBuilder();
    boolean first = true;

    for (String element : list) {
      if (first) {
        first = false;
      } else {
        joined.append(",");
      }
      joined.append(element);
    }

    return joined.toString();
  }
1239255
protected void writeObjectHeader(List<Object> list) {
        // action
        list.add("{\"" + getOperation() + "\":{");

        // flag indicating whether a comma needs to be added between fields
        boolean commaMightBeNeeded = false;

        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.INDEX, indexExtractor), "", commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TYPE, typeExtractor), "\"_type\":", commaMightBeNeeded);
        commaMightBeNeeded = id(list, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.PARENT, parentExtractor), requestParameterNames.parent, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValueAsFieldWriter(list, getMetadataExtractorOrFallback(Metadata.ROUTING, routingExtractor), requestParameterNames.routing, commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TTL, ttlExtractor), "\"_ttl\":", commaMightBeNeeded);
        commaMightBeNeeded = addExtractorOrDynamicValue(list, getMetadataExtractorOrFallback(Metadata.TIMESTAMP, timestampExtractor), "\"_timestamp\":", commaMightBeNeeded);

        // version & version_type fields
        Object versionField = getMetadataExtractorOrFallback(Metadata.VERSION, versionExtractor);
        if (versionField != null) {
            if (commaMightBeNeeded) {
                list.add(",");
                commaMightBeNeeded = false;
            }
            commaMightBeNeeded = true;
            list.add(requestParameterNames.version);
            list.add(versionField);

            // version_type - only needed when a version is specified
            Object versionTypeField = getMetadataExtractorOrFallback(Metadata.VERSION_TYPE, versionTypeExtractor);
            if (versionTypeField != null) {
                if (commaMightBeNeeded) {
                    list.add(",");
                    commaMightBeNeeded = false;
                }
                commaMightBeNeeded = true;
                list.add(requestParameterNames.versionType);
                list.add(versionTypeField);
            }
        }

        // useful for update command
        otherHeader(list, commaMightBeNeeded);
        list.add("}}\n");
    }
781241
public static int indexOf (int[] list, int value)
    {
        int llength = list.length; // no optimizing bastards
        for (int i = 0; i < llength; i++) {
            if (list[i] == value) {
                return i;
            }
        }
        return -1;
    }
680905
protected static int indexOf (
        EqualityComparator eqc, Object[] list, Object element)
    {
        requireNotNull(element);
        if (list != null) {
            for (int ii = 0, nn = list.length; ii < nn; ii++) {
                if (eqc.equals(element, list[ii])) {
                    return ii;
                }
            }
        }
        return -1;
    }
497459
public static <T> JavaFXListBinder<T> bind(ObservableList<T> list) {
        requireNonNull(list, "list");
        return new DefaultJavaFXListBinder(list);
    }
455781
@Override
    synchronized public final void set(List<Map<Integer, Integer>> list) {
        this.clear();
        mappings.addAll(list);
    }
4082
public final void typeList() throws RecognitionException {
		int typeList_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:347:5: ( type ( ',' type )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:347:7: type ( ',' type )*
			{
			pushFollow(FOLLOW_type_in_typeList603);
			type();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:347:12: ( ',' type )*
			loop30:
			while (true) {
				int alt30=2;
				int LA30_0 = input.LA(1);
				if ( (LA30_0==43) ) {
					alt30=1;
				}

				switch (alt30) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:347:13: ',' type
					{
					match(input,43,FOLLOW_43_in_typeList606); if (state.failed) return;
					pushFollow(FOLLOW_type_in_typeList608);
					type();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop30;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 18, typeList_StartIndex); }

		}
	}
313346
public void add(List list) {
	if (values == null) values = new LinkedList();
	values.add(list);
    }
38464
public void tableSwitch(int[] keys, TableSwitchGenerator generator, boolean useTable) {
    adapter.tableSwitch(keys, generator, useTable);
  }
466483
protected String join(Collection<?> list, String delimiter) {
        return Joiner.on(delimiter).join(list);
    }
1064912
private void appendList(StringBuffer buffer, List<Object> list) {

        Iterator<Object> iter = list.iterator();
        while (iter.hasNext()) {
            Object entry = iter.next();
            buffer.append(entry).append("<br/>\n");
        }
    }
1190460
private R pushExprList(ExpressionList<T> list) {
    if (textMode) {
      textStack.push(list);
    } else {
      whereStack.push(list);
    }
    return root;
  }
391430
public void addAll( List<T> list ) {
		if( list.isEmpty() )
			return;

		Element<T> a = requestNew();
		a.object = list.get(0);

		if( first == null ) {
			first = a;
		} else if( last != null ) {
			last.next = a;
			a.previous = last;
		}

		for (int i = 1; i < list.size(); i++) {
			Element<T> b = requestNew();
			b.object = list.get(i);

			a.next = b;
			b.previous = a;
			a = b;
		}

		last = a;
		size += list.size();
	}
1131957
public static int indexOf(List<Node> list , int value ) {

		for (int i = 0; i < list.size(); i++) {
			if( list.get(i).which == value )
				return i;
		}

		return -1;
	}
489788
public void setList(List<?> list) {
		this.checkNull(list);
		this.list.add(list);
		this.type.add(List.class);
	}