Show / Hide Table of Contents

Class FeatureDescriptor

Represents a feature with name and type.

Inheritance
System.Object
FeatureDescriptor
FeatureDescriptor<T>
Namespace: SigStat.Common
Assembly: SigStat.Common.dll
Syntax
public class FeatureDescriptor : object

Constructors

| Improve this Doc View Source

FeatureDescriptor(String, String, Type)

Initializes a new instance of the FeatureDescriptor class, and adds it to the static descriptors. Therefore, the key parameter must be unique.

Declaration
protected FeatureDescriptor(string name, string key, Type featureType)
Parameters
Type Name Description
System.String name
System.String key
Type featureType

Fields

| Improve this Doc View Source

descriptors

The static dictionary of all descriptors.

Declaration
protected static readonly Dictionary<string, FeatureDescriptor> descriptors
Field Value
Type Description
Dictionary<System.String, FeatureDescriptor>

Properties

| Improve this Doc View Source

FeatureType

Gets or sets the type of the feature.

Declaration
public Type FeatureType { get; set; }
Property Value
Type Description
Type
| Improve this Doc View Source

IsCollection

Gets whether the type of the feature is List.

Declaration
public bool IsCollection { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Key

Gets the unique key of the feature.

Declaration
public string Key { get; protected set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Name

Gets or sets a human readable name of the feature.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

Get(String)

Gets the FeatureDescriptor specified by key. Throws exception if there is no descriptor registered with the given key.

Declaration
public static FeatureDescriptor Get(string key)
Parameters
Type Name Description
System.String key
Returns
Type Description
FeatureDescriptor
| Improve this Doc View Source

Get<T>(String)

Gets the FeatureDescriptor<T> specified by key. If the key is not registered yet, a new FeatureDescriptor<T> is automatically created with the given key and type.

Declaration
public static FeatureDescriptor<T> Get<T>(string key)
Parameters
Type Name Description
System.String key
Returns
Type Description
FeatureDescriptor<T>
Type Parameters
Name Description
T
| Improve this Doc View Source

GetAll()

Gets a dictionary of all registered feature descriptors

Declaration
public static Dictionary<string, FeatureDescriptor> GetAll()
Returns
Type Description
Dictionary<System.String, FeatureDescriptor>
| Improve this Doc View Source

IsRegistered(String)

Returns true, if there is a FeatureDescriptor registered with the given key

Declaration
public static bool IsRegistered(string featureKey)
Parameters
Type Name Description
System.String featureKey

The key to search for

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Register(String, Type)

Registers a new FeatureDescriptor with a given key. If the FeatureDescriptor is allready registered, this function will return a reference to the originally registered FeatureDescriptor. to the a

Declaration
public static FeatureDescriptor Register(string featureKey, Type type)
Parameters
Type Name Description
System.String featureKey

The key for identifying the FeatureDescriptor

Type type

The type of the actual feature values represented by FeatureDescriptor

Returns
Type Description
FeatureDescriptor

A reference to the registered FeatureDescriptor instance

| Improve this Doc View Source

ToString()

Returns a string represenatation of the FeatureDescriptor

Declaration
public override string ToString()
Returns
Type Description
System.String
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX