Add a modified Index

@param string $indexName
@param Index  $fromIndex
@param Index  $toIndex
328811
public function addModifiedIndex($indexName, Index $fromIndex, Index $toIndex)
    {
        $this->modifiedIndices[$indexName] = array($fromIndex, $toIndex);
    }
373085
protected function addRenameColumn(&$property, $from, $to)
    {
        $property .= sprintf("%s('%s', '%s')", $this->getPropertyBase('renameColumn'), $from, $to);

        return $this;
    }
418867
public boolean createSingleIndex(String indexName) throws
            ElasticsearchException {
        CreateIndexRequest indexRequest = new CreateIndexRequest(indexName);
        CreateIndexResponse res = this.client.admin().indices().create(indexRequest).actionGet();
        return indexExists(indexName);
    }
401072
public function addWithIndex($index, $element)
    {
        if (!is_null($index)
            && is_scalar($index)
        ) {
            if (!$this->hasIndex($index)) {
                $this->set($index, $element);
            } else {
                // index already exist
                throw new ListException('Element could not be added to list. Index already exist.', E_NOTICE);
            }
        } else {
            // given index name is not valid
            throw new ListException('Element could not be added to list. Index is not valid.', E_NOTICE);
        }
    }
18349
public function indexOf($searchElement, $fromIndex = 0)
    {
        $result = array_search($searchElement, $this->getArrayCopy(), true);

        return $result === false ? -1 : $result + $fromIndex;

        // if ($fromIndex < 0) {
        //     $fromIndex = $this->length() + $fromIndex;
        // }
        // $result = array_search($searchElement, $this->slice($fromIndex)->getArrayCopy(), true);

        // return $result === false ? -1 : $result + $fromIndex;
    }
947789
public function dropMorphs($name, $indexName = null)
    {
        $this->dropIndex($indexName ?: $this->createIndexName('index', ["{$name}_type", "{$name}_id"]));

        $this->dropColumn("{$name}_type", "{$name}_id");
    }
805446
public function createIndex($tableName, $indexName, $indexSpec)
    {
        $this->query("ALTER TABLE \"$tableName\" ADD " . $this->getIndexSqlDefinition($indexName, $indexSpec));
    }
851221
public function upsertToIndex($subject, $indexName = null)
    {
        $indexName = $this->resolveIndexName($indexName);

        if ($subject instanceof Searchable) {
            $subject = [$subject];
        }

        if (is_array($subject) || $subject instanceof Traversable) {
            $searchableItems = collect($subject)
                ->each(function ($item) {
                    if (!$item instanceof Searchable) {
                        throw new InvalidArgumentException();
                    }
                })
                ->flatMap(function ($item) use($indexName) {
                    return
                        [
                            [
                                'index' => [
                                    '_id'    => $item->getSearchableId(),
                                    '_index' => $indexName,
                                    '_type'  => $item->getSearchableType(),
                                ],
                            ],

                            $item->getSearchableBody(),
                        ];
                })
                ->toArray();

            $payload['body'] = $searchableItems;

            $this->elasticsearch->bulk($payload);

            return;
        }

        throw new InvalidArgumentException('Subject must be a searchable or array of searchables');
    }
1330230
public function addIndex(array $columnNames, $indexName = null, array $flags = [], array $options = [])
    {
        if ($indexName === null) {
            $indexName = $this->_generateIdentifierName(
                array_merge([$this->getName()], $columnNames),
                'idx',
                $this->_getMaxIdentifierLength()
            );
        }

        return $this->_addIndex($this->_createIndex($columnNames, $indexName, false, false, $flags, $options));
    }
424287
protected function addIndex(&$property, Index $index)
    {
        $property .= sprintf("('%s')", $this->getPropertyBase($index->getType), $index->name);

        return $this->addFieldPropertyClousure($property);
    }
1349820
private static void checkRange(int fromIndex, int toIndex) {
		if (fromIndex < 0)
			throw new IndexOutOfBoundsException("fromIndex < 0: " + fromIndex);
		if (toIndex < 0)
			throw new IndexOutOfBoundsException("toIndex < 0: " + toIndex);
		if (fromIndex > toIndex)
			throw new IndexOutOfBoundsException("fromIndex: " + fromIndex +
					" > toIndex: " + toIndex);
	}
435721
public void add(int index, Object element) {

//        reporter.updateCounter++;
        if (index > elementCount) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + ">" + elementCount);
        }

        if (index < 0) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " < 0");
        }

        if (elementCount >= elementData.length) {
            increaseCapacity();
        }

        for (int i = elementCount; i > index; i--) {
            elementData[i] = elementData[i - 1];
        }

        elementData[index] = element;

        elementCount++;
    }
473491
public function addModifiedFk($fkName, ForeignKey $fromFk, ForeignKey $toFk)
    {
        $this->modifiedFks[$fkName] = [ $fromFk, $toFk ];
    }
706724
protected function addRedirect($from, $to)
    {
        $fromLink = $this->stripLinkBase($from);
        $toLink = $this->stripLinkBase($to);

        // If the redirect "from" is already registered with a "to", don't override it. This ensures
        // that the first version processed is treated as the canonical version.
        if (!isset($this->redirects[$fromLink])) {
            $this->redirects[$fromLink] = $toLink;
        }
    }
274476
public function addIndex(Index $index)
    {
        if ($this->hasIndex($index->getName())) {
            throw SchemaException::tableIndexAlreadyExists($this->getName(), $index->getName());
        }

        foreach ($index->getColumnNames() as $columnName) {
            if (!$this->hasColumn($columnName)) {
                throw SchemaException::tableColumnDoesNotExist($this->getName(), $columnName);
            }
        }

        foreach ($this->getIndexes() as $indexCandidate) {
            if ($indexCandidate->isBetterThan($index)) {
                return;
            }
        }

        foreach ($this->getIndexes() as $indexCandidate) {
            if ($index->isBetterThan($indexCandidate)) {
                $this->dropIndex($indexCandidate->getName());
            }
        }

        $this->indexes[$index->getName()] = $index;
    }
772776
public function shiftTo(int $index, int $newIndex) : void
    {
        while ($index > $newIndex) {
            $this->shiftDown($index);
            $index--;
        }
        while ($index < $newIndex) {
            $this->shiftUp($index);
            $index++;
        }
    }
761047
public static int indexAny(String target, Integer fromIndex, String... indexWith) {
		return indexAny(target, fromIndex, Arrays.asList(indexWith));
	}