C# Class clojure.lang.PersistentStructMap

Inheritance: APersistentMap, IObj
显示文件 Open project: richhickey/clojure-clr Class Usage Examples

Public Methods

Method Description
assoc ( object key, object val ) : IPersistentMap

Add a new key/value pair.

Overwrites an exising value for the key, if present.

assocEx ( object key, object val ) : IPersistentMap

Add a new key/value pair.

Throws an exception if key has a value already.

containsKey ( object key ) : bool

Test if the map contains a key.

count ( ) : int

Gets the number of items in the collection.

empty ( ) : IPersistentCollection

Gets an empty collection of the same type.

entryAt ( object key ) : IMapEntry

Returns the key/value pair for this key.

meta ( ) : IPersistentMap
seq ( ) : ISeq

Gets an ISeq to allow first/rest iteration through the collection.

valAt ( object key ) : object

Gets the value associated with a key.

valAt ( object key, object notFound ) : object

Gets the value associated with a key.

withMeta ( IPersistentMap meta ) : IObj

Create a copy with new metadata.

without ( object key ) : IPersistentMap

Remove a key entry.

Protected Methods

Method Description
PersistentStructMap ( IPersistentMap meta, Def def, Object vals, IPersistentMap ext ) : System

Initialize a struct from given data.

Private Methods

Method Description
construct ( Def def, ISeq valseq ) : PersistentStructMap
create ( Def def, ISeq keyvals ) : PersistentStructMap
createSlotMap ( ISeq keys ) : Def
getAccessor ( Def def, object key ) : IFn
makeNew ( IPersistentMap meta, Def def, object vals, IPersistentMap ext ) : PersistentStructMap

Method Details

PersistentStructMap() protected method

Initialize a struct from given data.
protected PersistentStructMap ( IPersistentMap meta, Def def, Object vals, IPersistentMap ext ) : System
meta IPersistentMap The metadata to attach.
def Def The structure definition.
vals Object Values for the fixed keys.
ext IPersistentMap Additional keys/values.
return System

assoc() public method

Add a new key/value pair.
Overwrites an exising value for the key, if present.
public assoc ( object key, object val ) : IPersistentMap
key object The key
val object The value
return IPersistentMap

assocEx() public method

Add a new key/value pair.
Throws an exception if key has a value already.
public assocEx ( object key, object val ) : IPersistentMap
key object The key
val object The value
return IPersistentMap

containsKey() public method

Test if the map contains a key.
public containsKey ( object key ) : bool
key object The key to test for membership
return bool

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

entryAt() public method

Returns the key/value pair for this key.
public entryAt ( object key ) : IMapEntry
key object The key to retrieve
return IMapEntry

meta() public method

public meta ( ) : IPersistentMap
return IPersistentMap

seq() public method

Gets an ISeq to allow first/rest iteration through the collection.
public seq ( ) : ISeq
return ISeq

valAt() public method

Gets the value associated with a key.
public valAt ( object key ) : object
key object The key to look up.
return object

valAt() public method

Gets the value associated with a key.
public valAt ( object key, object notFound ) : object
key object The key to look up.
notFound object The value to return if the key is not present.
return object

withMeta() public method

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

without() public method

Remove a key entry.
public without ( object key ) : IPersistentMap
key object The key to remove
return IPersistentMap