C# Class clojure.lang.APersistentVector.SubVector

Internal class providing subvector functionality for APersistentVector.
Inheritance: APersistentVector, IPersistentCollection
Datei anzeigen Open project: arohner/clojure-contrib

Public Methods

Method 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

Method 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 method

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.
return System

assocN() public method

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
return IPersistentVector

cons() public method

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.
return IPersistentVector

count() public method

Gets the number of items in the collection.
public count ( ) : int
return int

empty() public method

Gets an empty collection of the same type.
public empty ( ) : IPersistentCollection
return IPersistentCollection

length() public method

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

nth() public method

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/
return object

pop() public method

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

withMeta() public method

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