Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.parser.meta
Class ProjectionParser<V extends RealVector<V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.parser.meta.MetaParser<V>
              extended by de.lmu.ifi.dbs.elki.parser.meta.ProjectionParser<V>
Type Parameters:
V - the type of RealVector contained in both the ParsingResult of the base parser and the projected ParsingResult of this ProjectionParser
All Implemented Interfaces:
Parser<V>, Parameterizable
Direct Known Subclasses:
DoubleVectorProjectionParser, SparseFloatVectorProjectionParser

public abstract class ProjectionParser<V extends RealVector<V,?>>
extends MetaParser<V>

A ProjectionParser projects the ParsingResult of its base parser onto a subspace specified by a BitSet.

Author:
Arthur Zimek

Field Summary
static OptionID SELECTED_ATTRIBUTES_ID
          ID for the parameter SELECTED_ATTRIBUTES_PARAM.
private  IntListParameter SELECTED_ATTRIBUTES_PARAM
          Selected attributes parameter.
private  BitSet selectedAttributes
          Keeps the selection of the subspace to project onto.
 
Fields inherited from class de.lmu.ifi.dbs.elki.parser.meta.MetaParser
BASEPARSER_ID
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
protected ProjectionParser()
          Sets the parameter SELECTED_ATTRIBUTES_PARAM.
 
Method Summary
 BitSet getSelectedAttributes()
          Provides a BitSet with the bits set to true corresponding to the selected attributes in SELECTED_ATTRIBUTES_PARAM.
 List<String> setParameters(List<String> args)
          Grabs all specified options from the option handler.
 void setSelectedAttributes(BitSet selectedAttributes)
          Sets the bits set to true in the given BitSet as selected attributes in SELECTED_ATTRIBUTES_PARAM.
 
Methods inherited from class de.lmu.ifi.dbs.elki.parser.meta.MetaParser
retrieveBaseParsingresult, toString
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.parser.Parser
parse
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

selectedAttributes

private BitSet selectedAttributes
Keeps the selection of the subspace to project onto.


SELECTED_ATTRIBUTES_ID

public static final OptionID SELECTED_ATTRIBUTES_ID
ID for the parameter SELECTED_ATTRIBUTES_PARAM.


SELECTED_ATTRIBUTES_PARAM

private final IntListParameter SELECTED_ATTRIBUTES_PARAM

Selected attributes parameter.

Key: -projectionparser.selectedattributes

Constructor Detail

ProjectionParser

protected ProjectionParser()
Sets the parameter SELECTED_ATTRIBUTES_PARAM.

Method Detail

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Description copied from class: AbstractParameterizable
Grabs all specified options from the option handler. Any extending class should call this method first and return the returned array without further changes, but after setting further required parameters. An example for overwriting this method taking advantage from the previously (in superclasses) defined options would be:

 {
   List remainingParameters = super.setParameters(args);
   // set parameters for your class
   // for example like this:
   if(isSet(MY_PARAM_VALUE_PARAM))
   {
      myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
   }
   .
   .
   .
   return remainingParameters;
   // or in case of attributes requesting parameters themselves
   // return parameterizableAttribbute.setParameters(remainingParameters);
 }
 

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class MetaParser<V extends RealVector<V,?>>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting
See Also:
AbstractParameterizable.setParameters(java.util.List)

setSelectedAttributes

public void setSelectedAttributes(BitSet selectedAttributes)

Sets the bits set to true in the given BitSet as selected attributes in SELECTED_ATTRIBUTES_PARAM.

The index in the BitSet is expected to be shifted to the left by one, i.e., index 0 in the BitSet relates to the first attribute.

Parameters:
selectedAttributes - the new selected attributes

getSelectedAttributes

public BitSet getSelectedAttributes()

Provides a BitSet with the bits set to true corresponding to the selected attributes in SELECTED_ATTRIBUTES_PARAM.

The index in the BitSet is shifted to the left by one, i.e., index 0 in the BitSet relates to the first attribute.

Returns:
the selected attributes

Release 0.2 (2009-07-06_1820)