AbstractStringListFeature Class Reference

#include <AbstractString.h>

Inheritance diagram for AbstractStringListFeature:

AbstractStringFeature PersistantFeature Feature BluetoothPeersFeature SystemCommandStringListFeature WlanPeersFeature List of all members.

Public Member Functions

virtual string serialize () const
virtual void unserialize (string value)
virtual double getPosition () const
virtual double getDistance (Feature *f) const
virtual void moveTowards (Feature *f, double factor)
virtual Featureclone () const
virtual const string getName () const
const bit_vector & getListVal () const
const stringvectorgetListValues () const
virtual string toString () const

Protected Member Functions

 AbstractStringListFeature (stringcode *code, long *maxlen)
 AbstractStringListFeature (stringcode *code, long *maxlen, const stringvector *names)
bit_vector getCodeForList (const stringvector *names)

Protected Attributes

bit_vector listval

Detailed Description

Baseclass for features providing lists of string values

A feature of type nominal which has lists of strings as values.


Constructor & Destructor Documentation

AbstractStringListFeature::AbstractStringListFeature stringcode code,
long *  maxlen
[protected]
 

Feature constructor

This constructor initializes the feature as prototypes value. For creating a specific sample of a feature, the sample constructor should be used.

Parameters:
code A reference to a static variable (it must be same for all created objects of _one_ feature) for persistantly storing the code table.
maxlen A reference to a static variable (it must be same for all created objects of _one_ feature) for persistantly storing the maximum string length.

AbstractStringListFeature::AbstractStringListFeature stringcode code,
long *  maxlen,
const stringvector names
[protected]
 

Sample constructor

This constructor initializes the feature with a specific value and should thus be used for samples.

Parameters:
code A reference to a static variable (it must be same for all created objects of _one_ feature) for persistantly storing the code table.
maxlen A reference to a static variable (it must be same for all created objects of _one_ feature) for persistantly storing the maximum string length.
names The string representation of the sample value.


Member Function Documentation

Feature * AbstractStringListFeature::clone  )  const [virtual]
 

Clone a feature

A feature must be able to clone itself. This is typically implemented with a copy constructor, but should return a new object.

Reimplemented from AbstractStringFeature.

bit_vector AbstractStringListFeature::getCodeForList const stringvector names  )  [protected]
 

Get a code value for a given stringvector

The function composes a bit_vector wherein for each string in the stringvector the bit on the position of the strings code value is set to true. The remaining bits are initialized to false.

Parameters:
names The stringvector to code
Returns:
A code value as bit_vector

double AbstractStringListFeature::getDistance Feature f  )  const [virtual]
 

Todo:
this should not happen, find the reason for that

Reimplemented from AbstractStringFeature.

const bit_vector& AbstractStringListFeature::getListVal  )  const [inline]
 

Query the list of values

Returns:
Values list

const stringvector& AbstractStringListFeature::getListValues  )  const [inline]
 

Query the list of values

Returns:
Values list

virtual const string AbstractStringListFeature::getName  )  const [inline, virtual]
 

Query a features name

Returns:
Name of the Feature in the format "Featureprovider.Feature"

Reimplemented from AbstractStringFeature.

Reimplemented in BluetoothPeersFeature, SystemCommandStringListFeature, and WlanPeersFeature.

double AbstractStringListFeature::getPosition  )  const [virtual]
 

Query a features position

Returns:
The distance to the origin. Every implementation must take care that only values in the interval [0; 1] are returned.
Remarks:
This function is only for the purpose of internal search operations and visualisation and should not be used in any other context.

Reimplemented from AbstractStringFeature.

void AbstractStringListFeature::moveTowards Feature f,
double  factor
[virtual]
 

Todo:
implement a better 'get string for code'

Reimplemented from AbstractStringFeature.

string AbstractStringListFeature::serialize  )  const [virtual]
 

Serialize a samples data to a string

Returns:
String representation of the samples data.

Reimplemented from AbstractStringFeature.

string AbstractStringListFeature::toString  )  const [virtual]
 

Get feature as string

Note:
This is only for testing.
Returns:
Feature as string.

Reimplemented from AbstractStringFeature.

Reimplemented in BluetoothPeersFeature, SystemCommandStringListFeature, and WlanPeersFeature.

void AbstractStringListFeature::unserialize string  value  )  [virtual]
 

Unserialize a samples data from a string

Parameters:
value String representation of the samples data.

Reimplemented from AbstractStringFeature.


Member Data Documentation

bit_vector AbstractStringListFeature::listval [protected]
 

The coded value of the feature.

See also:
names

code


The documentation for this class was generated from the following files:
Generated on Mon Jun 5 10:20:49 2006 for Intelligence.kdevelop by  doxygen 1.4.6