Replaces the expression at {@code index} in this expression
with {@code newConstantExpression} (as a constant expression).

@param index
@param newConstantExpression
@return
765732
public Expression2 substitute(int index, String newConstantExpression) {
    return substitute(index, Expression2.constant(newConstantExpression));
  }
202408
public Signature dropArg(int index) {
        assert index < argNames.length;

        String[] newArgNames = new String[argNames.length - 1];
        if (index > 0) System.arraycopy(argNames, 0, newArgNames, 0, index);
        if (index < argNames.length - 1)
            System.arraycopy(argNames, index + 1, newArgNames, index, argNames.length - (index + 1));

        MethodType newType = methodType.dropParameterTypes(index, index + 1);

        return new Signature(newType, newArgNames);
    }
597474
public static <E> E at(long index, Iterator<E> iterator) {
        final Iterator<E> filtered = new FilteringIterator<E>(iterator, new AtIndex<E>(index));
        return new FirstElement<E>().apply(filtered);
    }
1145804
private int incrementIndex(int index, int maxIndex) {
		int newIndex = index + 1;
		if (newIndex >= elements.length) {
			newIndex = maxIndex;
		}
		return newIndex;
	}
268232
public String getPrefix(int index) {
        if (index < 0 || index >= mAttrCount) {
            throwIndex(index);
        }
        return mAttributes[index].mPrefix;
    }
848443
private void checkConstantPoolIndex(int index) throws InvalidClassFileFormatException {
        if (index < 0 || index >= constantPool.length || constantPool[index] == null) {
            throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
        }
    }
928507
public boolean create(String index) {
        CreateIndexRequestBuilder createIndexRequestBuilder =
                admin().indices().prepareCreate(index);
        return JMElasticsearchUtil.logRequestQueryAndReturn("create",
                createIndexRequestBuilder,
                createIndexRequestBuilder.execute())
                .isAcknowledged();
    }
1260480
private MethodRefConstant parseMethodRefConstant(int index)
    throws IOException
  {
    int classIndex = readShort();
    int nameAndTypeIndex = readShort();

    return new MethodRefConstant(_class.getConstantPool(), index,
                                 classIndex, nameAndTypeIndex);
  }
258992
public static Expression<?> toExpression(Object o) {
        if (o instanceof Expression) {
            return (Expression<?>) o;
        } else {
            return ConstantImpl.create(o);
        }
    }
1197904
public void pushConstant(ConstantExpression expression) {
        MethodVisitor mv = controller.getMethodVisitor();
        Object value = expression.getValue();
        ClassNode origType = expression.getType().redirect();
        ClassNode type = ClassHelper.getUnwrapper(origType);
        boolean boxing = origType!=type;
        boolean asPrimitive = boxing || ClassHelper.isPrimitiveType(type);

        if (value == null) {
            mv.visitInsn(ACONST_NULL);
        } else if (boxing && value instanceof Boolean) {
            // special path for boxed boolean
            Boolean bool = (Boolean) value;
            String text = bool ? "TRUE" : "FALSE";
            mv.visitFieldInsn(GETSTATIC, "java/lang/Boolean", text, "Ljava/lang/Boolean;");
            boxing = false;
            type = origType;
        } else if (asPrimitive) {
            pushPrimitiveConstant(mv, value, type);
        } else if (value instanceof BigDecimal) {
            String className = BytecodeHelper.getClassInternalName(value.getClass().getName());
            mv.visitTypeInsn(NEW, className);
            mv.visitInsn(DUP);
            mv.visitLdcInsn(value.toString());
            mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", "(Ljava/lang/String;)V", false);
        } else if (value instanceof BigInteger) {
            String className = BytecodeHelper.getClassInternalName(value.getClass().getName());
            mv.visitTypeInsn(NEW, className);
            mv.visitInsn(DUP);
            mv.visitLdcInsn(value.toString());
            mv.visitMethodInsn(INVOKESPECIAL, className, "<init>", "(Ljava/lang/String;)V", false);
        } else if (value instanceof String) {
            mv.visitLdcInsn(value);
        } else {
            throw new ClassGeneratorException(
                    "Cannot generate bytecode for constant: " + value + " of type: " + type.getName());
        }
        
        push(type);
        if (boxing) box(); 
    }
544075
public Name getPrefix(int index) {
		LinkedList newNames = new LinkedList();
		for (int i = 0; i < index; i++) {
			newNames.add(names.get(i));
		}

		return new DistinguishedName(newNames);
	}
1174574
private LongConstant parseLongConstant(int index)
    throws IOException
  {
    long value = readLong();

    return new LongConstant(_class.getConstantPool(), index, value);
  }
263292
public final int getConstantIndex(String constant)
    {
        int nameIndex = getNameIndex(constant);
        for (ConstantInfo ci : listConstantInfo(ConstantString.class))
        {
            ConstantString ic = (ConstantString) ci;
            if (nameIndex == ic.getString_index())
            {
                return constantPoolIndexMap.get(ci);
            }
        }
        return -1;
    }
1053938
@Nonnull
  public CSSDeclaration setExpression (@Nonnull final CSSExpression aExpression)
  {
    m_aExpression = ValueEnforcer.notNull (aExpression, "Expression");
    return this;
  }
1081251
public Arguments set(final int index,
                         final String s) {
        final Pointer<String> stringPointer = nref(s);
        this.argumentRefs.add(stringPointer);
        this.pointer.get(index)
                    .setS(stringPointer);
        return this;
    }
798554
public boolean set(int index) {
        if(index < 0 || index >= size)
            throw new IndexOutOfBoundsException("index: " + index);

        int wordIndex=wordIndex(index);
        boolean already_set=(words[wordIndex] & (1L << index)) != 0;
        words[wordIndex]|=(1L << index); // Restores invariants
        return !already_set;
    }
672194
private void appendExpression(final BooleanExpression newExpression) {
		if (lhsExpression != null) {
			throw new SyntaxException("Syntax exception: use AND or OR to join expressions");
		}

		lhsExpression = newExpression;

		GroupExpression currentExpression = stack.isEmpty() ? null : stack.peek();

		if (currentExpression == null) {
			this.expression.setExpression(newExpression);
		} else {
			currentExpression.add(newExpression);
		}
	}