C# Class Agnos.HeteroMap

an heterogeneous map. it is basically a regular Dictionary, but it associates with each entry a packer for the key and a packer for the value. for "simple types", for which a packer can be inferred, you may use the 2-argument version of Add() or the [] operator, but for all other types, you should use the 4-argument version of Add(), where you specify the packers for the key and value. note: this class implements IDictionary, so it can be used by third-party code, but only for "simple types", for which a packer can be inferred
Inheritance: IDictionary
Exibir arquivo Open project: tomerfiliba/agnos Class Usage Examples

Protected Properties

Property Type Description
data System.Collections.Hashtable
fields FieldInfo>.Dictionary

Public Methods

Method Description
Add ( Object key, Object value ) : void

a Version of Add that implements IDictionary.Add. It attempts to infer the packers for the key and for the value

Add ( Object key, Object value, Packers valpacker ) : void

specialized version of Add that attempts to infer the packer for the key, but the packer for the value must be provided

Add ( Object key, Packers keypacker, Object value, Packers valpacker ) : void

Adds the given given value (with the given value-packer) under the given key (with the given key packer)

Add ( String key, String value ) : void

specialized version of Add

Add ( String key, int value ) : void

specialized version of Add

Add ( int key, String value ) : void

specialized version of Add

Add ( int key, int value ) : void

specialized version of Add

AddNewMap ( String name ) : HeteroMap

Adds a new HeteroMap instance to this HeteroMap under the given key This is a convenience function, used by the Agnos binding code, but it's not expected to be useful to the general public.

Clear ( ) : void
Contains ( Object key ) : bool
ContainsKey ( Object key ) : bool
ContainsValue ( Object value ) : bool
CopyTo ( Array array, int arrayIndex ) : void
GetEnumerator ( ) : IDictionaryEnumerator
HeteroMap ( ) : System
HeteroMap ( HeteroMap other ) : System
HeteroMap ( int capacity ) : System
Remove ( object key ) : void
ToString ( ) : string
TryGetValue ( Object key, Object &value ) : bool
Update ( HeteroMap other ) : void
getKeyPacker ( Object key ) : Packers.AbstractPacker

returns the key-packer associated with the given vey

getValuePacker ( Object key ) : Packers.AbstractPacker

returns the value-packer associated with the given vey

this ( Object key ) : Object

Protected Methods

Method Description
ToStringHelper ( String indent, StringBuilder sb ) : void
getPackerForBuiltinType ( object val ) : Packers.AbstractPacker

Private Methods

Method Description
IEnumerable ( ) : IEnumerator

Method Details

Add() public method

a Version of Add that implements IDictionary.Add. It attempts to infer the packers for the key and for the value
public Add ( Object key, Object value ) : void
key Object
value Object
return void

Add() public method

specialized version of Add that attempts to infer the packer for the key, but the packer for the value must be provided
public Add ( Object key, Object value, Packers valpacker ) : void
key Object
value Object
valpacker Packers
return void

Add() public method

Adds the given given value (with the given value-packer) under the given key (with the given key packer)
public Add ( Object key, Packers keypacker, Object value, Packers valpacker ) : void
key Object /// The key (any object) ///
keypacker Packers /// The packer for the key (an AbstractPacker) ///
value Object /// The value (any object) ///
valpacker Packers /// The packer for the value (an AbstractPacker) ///
return void

Add() public method

specialized version of Add
public Add ( String key, String value ) : void
key String
value String
return void

Add() public method

specialized version of Add
public Add ( String key, int value ) : void
key String
value int
return void

Add() public method

specialized version of Add
public Add ( int key, String value ) : void
key int
value String
return void

Add() public method

specialized version of Add
public Add ( int key, int value ) : void
key int
value int
return void

AddNewMap() public method

Adds a new HeteroMap instance to this HeteroMap under the given key This is a convenience function, used by the Agnos binding code, but it's not expected to be useful to the general public.
public AddNewMap ( String name ) : HeteroMap
name String /// The key ///
return HeteroMap

Clear() public method

public Clear ( ) : void
return void

Contains() public method

public Contains ( Object key ) : bool
key Object
return bool

ContainsKey() public method

public ContainsKey ( Object key ) : bool
key Object
return bool

ContainsValue() public method

public ContainsValue ( Object value ) : bool
value Object
return bool

CopyTo() public method

public CopyTo ( Array array, int arrayIndex ) : void
array System.Array
arrayIndex int
return void

GetEnumerator() public method

public GetEnumerator ( ) : IDictionaryEnumerator
return IDictionaryEnumerator

HeteroMap() public method

public HeteroMap ( ) : System
return System

HeteroMap() public method

public HeteroMap ( HeteroMap other ) : System
other HeteroMap
return System

HeteroMap() public method

public HeteroMap ( int capacity ) : System
capacity int
return System

Remove() public method

public Remove ( object key ) : void
key object
return void

ToString() public method

public ToString ( ) : string
return string

ToStringHelper() protected method

protected ToStringHelper ( String indent, StringBuilder sb ) : void
indent String
sb StringBuilder
return void

TryGetValue() public method

public TryGetValue ( Object key, Object &value ) : bool
key Object
value Object
return bool

Update() public method

public Update ( HeteroMap other ) : void
other HeteroMap
return void

getKeyPacker() public method

returns the key-packer associated with the given vey
public getKeyPacker ( Object key ) : Packers.AbstractPacker
key Object
return Packers.AbstractPacker

getPackerForBuiltinType() protected method

protected getPackerForBuiltinType ( object val ) : Packers.AbstractPacker
val object
return Packers.AbstractPacker

getValuePacker() public method

returns the value-packer associated with the given vey
public getValuePacker ( Object key ) : Packers.AbstractPacker
key Object
return Packers.AbstractPacker

this() public method

public this ( Object key ) : Object
key Object
return Object

Property Details

data protected_oe property

protected Hashtable,System.Collections data
return System.Collections.Hashtable

fields protected_oe property

protected Dictionary fields
return FieldInfo>.Dictionary