All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.krukow.clj_ds.PersistentVector Maven / Gradle / Ivy

package com.github.krukow.clj_ds;

import java.util.List;

/**
 * A {@link PersistentCollection} that has array-like runtime characteritics.
 * New elements are "added" at the end of the {@link PersistentVector}.
 */
public interface PersistentVector extends PersistentStack, List, Indexed, Comparable, EditableCollection {

	PersistentVector zero();

	/**
	 * @return A new {@link PersistentVector} consisting of the elements of the
	 *         current {@link PersistentVector} followed by the value val.
	 */
	PersistentVector plus(E val);

	/**
	 * @return A new {@link PersistentVector} consisting of the elements of
	 *         current {@link PersistentVector} where the element at index i has
	 *         been replaced by the value val.
	 * @throw {@link IndexOutOfBoundsException} if the index i is greater that
	 *        the current maximum index.
	 */
	PersistentVector plusN(int i, E val);

	/**
	 * @return A new {@link PersistentVector} consisting of the elements of
	 *         the current {@link PersistentVector} without its last element.
	 */
	PersistentVector minus();

	TransientVector asTransient();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy