C# Class clojure.lang.PersistentTreeSet

Inheritance: APersistentSet, IObj, Reversible, Sorted
显示文件 Open project: arohner/clojure-contrib Class Usage Examples

Public Properties

Property Type Description
EMPTY PersistentTreeSet

Public Methods

Method Description
comparator ( ) : System.Collections.IComparer

Returns the comparer used to sort the elements in the collection.

Would be called Comparer except we need to match the JVM name.

cons ( object o ) : IPersistentCollection

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

create ( ) : PersistentTreeSet

Create a PersistentTreeSet from arbitrary arguments.

create ( IList init ) : PersistentTreeSet

Create a PersistentTreeSet initialized from an IList.

create ( ISeq init ) : PersistentTreeSet

Create a PersistentTreeSet initialized from an ISeq.

disjoin ( object key ) : IPersistentSet

Get a set with the given item removed.

empty ( ) : IPersistentCollection

Gets an empty collection of the same type.

entryKey ( object entry ) : object

Returns the key to be passed to the comparator to sort the element.

rseq ( ) : ISeq

Gets an ISeq to travers the sequence in reverse.

seq ( bool ascending ) : ISeq

Returns an ISeq to iterate through the collection in the designated direction.

seqFrom ( object key, bool ascending ) : ISeq

Returns an ISeq to iterate through the collection in the designated direction starting from a particular key.

The key need not be in the collection. If not present, the iteration will start with the first element with a key greater than (if asscending) or less than (if descending) the given key.

withMeta ( IPersistentMap meta ) : IObj

Create a copy with new metadata.

Private Methods

Method Description
PersistentTreeSet ( IPersistentMap meta, IPersistentMap impl ) : System

Initialize a PersistentTreeSet using given metadata and underlying implementation map.

Method Details

comparator() public method

Returns the comparer used to sort the elements in the collection.
Would be called Comparer except we need to match the JVM name.
public comparator ( ) : System.Collections.IComparer
return System.Collections.IComparer

cons() public method

Returns a new collection that has the given element cons'd on front of the existing collection.
public cons ( object o ) : IPersistentCollection
o object An item to put at the front of the collection.
return IPersistentCollection

create() public static method

Create a PersistentTreeSet from arbitrary arguments.
public static create ( ) : PersistentTreeSet
return PersistentTreeSet

create() public static method

Create a PersistentTreeSet initialized from an IList.
public static create ( IList init ) : PersistentTreeSet
init IList A list of elements
return PersistentTreeSet

create() public static method

Create a PersistentTreeSet initialized from an ISeq.
public static create ( ISeq init ) : PersistentTreeSet
init ISeq A sequence of elements.
return PersistentTreeSet

disjoin() public method

Get a set with the given item removed.
public disjoin ( object key ) : IPersistentSet
key object The item to remove.
return IPersistentSet

empty() public method

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

entryKey() public method

Returns the key to be passed to the comparator to sort the element.
public entryKey ( object entry ) : object
entry object An element in the collection.
return object

rseq() public method

Gets an ISeq to travers the sequence in reverse.
public rseq ( ) : ISeq
return ISeq

seq() public method

Returns an ISeq to iterate through the collection in the designated direction.
public seq ( bool ascending ) : ISeq
ascending bool A flag indicating if the iteration is ascending or descending.
return ISeq

seqFrom() public method

Returns an ISeq to iterate through the collection in the designated direction starting from a particular key.
The key need not be in the collection. If not present, the iteration will start with the first element with a key greater than (if asscending) or less than (if descending) the given key.
public seqFrom ( object key, bool ascending ) : ISeq
key object The key at which to start the iteration.
ascending bool A flag indicating if the iteration is ascending or descending.
return ISeq

withMeta() public method

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

Property Details

EMPTY public_oe static_oe property

An empty PersistentTreeSet.
public static PersistentTreeSet,clojure.lang EMPTY
return PersistentTreeSet