C# Class clojure.lang.APersistentVector.SubVector

Internal class providing subvector functionality for APersistentVector.
Inheritance: APersistentVector, IPersistentCollection
Afficher le fichier Open project: arohner/clojure-contrib

Méthodes publiques

Méthode Description
SubVector ( IPersistentMap meta, IPersistentVector v, int start, int end ) : System

Initialize a subvector, with the given metadata and start/end indices.

assocN ( int i, object val ) : IPersistentVector

Return a new vector with the i-th value set to val.

cons ( object o ) : IPersistentVector

Creates a new vector with a new item at the end.

count ( ) : int

Gets the number of items in the collection.

empty ( ) : IPersistentCollection

Gets an empty collection of the same type.

length ( ) : int

Gets the number of items in the vector.

Not sure why you wouldn't use count() intead.

nth ( int i ) : object

Get the i-th item in the vector.

Throws an exception if the index i is not in the range of the vector's elements.

pop ( ) : IPersistentStack

Returns a new stack with the top element popped.

withMeta ( IPersistentMap meta ) : IObj

Create a copy with new metadata.

Private Methods

Méthode Description
IPersistentCollection ( object o ) : IPersistentCollection

Returns a new collection that has the given element cons'd on front of the eixsting collection.

Method Details

SubVector() public méthode

Initialize a subvector, with the given metadata and start/end indices.
public SubVector ( IPersistentMap meta, IPersistentVector v, int start, int end ) : System
meta IPersistentMap The metatdata to attach.
v IPersistentVector The vector to subvector.
start int The start index of the subvector.
end int The end index of the subvector.
Résultat System

assocN() public méthode

Return a new vector with the i-th value set to val.
public assocN ( int i, object val ) : IPersistentVector
i int The index of the item to set.
val object The new value
Résultat IPersistentVector

cons() public méthode

Creates a new vector with a new item at the end.
public cons ( object o ) : IPersistentVector
o object The item to add to the vector.
Résultat IPersistentVector

count() public méthode

Gets the number of items in the collection.
public count ( ) : int
Résultat int

empty() public méthode

Gets an empty collection of the same type.
public empty ( ) : IPersistentCollection
Résultat IPersistentCollection

length() public méthode

Gets the number of items in the vector.
Not sure why you wouldn't use count() intead.
public length ( ) : int
Résultat int

nth() public méthode

Get the i-th item in the vector.
Throws an exception if the index i is not in the range of the vector's elements.
public nth ( int i ) : object
i int The index of the item to retrieve/
Résultat object

pop() public méthode

Returns a new stack with the top element popped.
public pop ( ) : IPersistentStack
Résultat IPersistentStack

withMeta() public méthode

Create a copy with new metadata.
public withMeta ( IPersistentMap meta ) : IObj
meta IPersistentMap The new metadata.
Résultat IObj