ILNumerics Ultimate VS

KeyMapperElementType, SubelementType Class

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Key mapper class, to be overriden for user defined classes to be sorted with bucket sort

[ILNumerics Core Module]

Inheritance Hierarchy

SystemObject
  ILNumerics.Core.MiscKeyMapperElementType, SubelementType
    ILNumerics.Core.MiscASCIIKeyMapper

Namespace:  ILNumerics.Core.Misc
Assembly:  ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public abstract class KeyMapper<ElementType, SubelementType>

Type Parameters

ElementType
Type of elements. Elements are constructed out of any number of subelements
SubelementType
Type of subelements

The KeyMapperElementType, SubelementType type exposes the following members.

Constructors

  NameDescription
Public methodKeyMapperElementType, SubelementType
Construct key mapper

[ILNumerics Core Module]

Top
Properties

  NameDescription
Public propertyNumberOfKeys
Maximum number of keys (different subitems)

[ILNumerics Core Module]

Top
Methods

  NameDescription
Public methodGetSubelement
Get subelement from element item

[ILNumerics Core Module]

Public methodMap(SubelementType)
Maps subelement types to bucket index

[ILNumerics Core Module]

Public methodMap(ElementType, Int32, Int32)
Map subelemt - provide fallback on error

[ILNumerics Core Module]

Public methodSubelementsCount
Count subelements in an element

[ILNumerics Core Module]

Top
Remarks

This class can be extended to enable sorting (bucket sort) for arbitrary types. The elements of those types may be devidable into subelements.

Examples of sortable classes: colors: number/type of subelements: 1/any (e.g. the color code). One should write a ILKeyMapper<Color,int>.strings: number/type of subelements: arbitrary/char. Here a sample ILASCIKeyMapper implementation exists already. This implementation is the default implementation used for bucket sort via ILMath.sort().trees: number/type of subelements: arbitrary/tree nodes. One should write a key mapper to map a node of a tree to a bucket number...

[ILNumerics Core Module]

See Also

Reference