org.apache.mahout.common.parameters
Class AbstractParameter<T>

java.lang.Object
  extended by org.apache.mahout.common.parameters.AbstractParameter<T>
All Implemented Interfaces:
Parameter<T>, Parametered
Direct Known Subclasses:
ClassParameter, DoubleParameter, PathParameter

public abstract class AbstractParameter<T>
extends Object
implements Parameter<T>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.mahout.common.parameters.Parametered
Parametered.ParameteredGeneralizations
 
Field Summary
 
Fields inherited from interface org.apache.mahout.common.parameters.Parametered
log
 
Constructor Summary
protected AbstractParameter(Class<T> type, String prefix, String name, org.apache.hadoop.conf.Configuration jobConf, T defaultValue, String description)
           
 
Method Summary
 void configure(org.apache.hadoop.conf.Configuration jobConf)
           
 void createParameters(String prefix, org.apache.hadoop.conf.Configuration jobConf)
          EXPERT: consumers should never have to call this method.
 String defaultValue()
           
 String description()
           
 T get()
           
 Collection<Parameter<?>> getParameters()
           
 String getStringValue()
           
 String name()
           
 String prefix()
           
 void set(T value)
           
 String toString()
           
 Class<T> type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.mahout.common.parameters.Parameter
setStringValue
 

Constructor Detail

AbstractParameter

protected AbstractParameter(Class<T> type,
                            String prefix,
                            String name,
                            org.apache.hadoop.conf.Configuration jobConf,
                            T defaultValue,
                            String description)
Method Detail

configure

public void configure(org.apache.hadoop.conf.Configuration jobConf)
Specified by:
configure in interface Parametered

createParameters

public void createParameters(String prefix,
                             org.apache.hadoop.conf.Configuration jobConf)
Description copied from interface: Parametered
EXPERT: consumers should never have to call this method. It would be friendly visible to Parametered.ParameteredGeneralizations if java supported it. Calling this method should create a new list of parameters and is called

Specified by:
createParameters in interface Parametered
Parameters:
prefix - ends with a dot if not empty.
jobConf - configuration used for retrieving values
See Also:
invoking method, invoking method

getStringValue

public String getStringValue()
Specified by:
getStringValue in interface Parameter<T>
Returns:
value string representation of current value

getParameters

public Collection<Parameter<?>> getParameters()
Specified by:
getParameters in interface Parametered

prefix

public String prefix()
Specified by:
prefix in interface Parameter<T>
Returns:
job configuration setting key prefix, e.g. 'org.apache.mahout.util.WeightedDistanceMeasure.'

name

public String name()
Specified by:
name in interface Parameter<T>
Returns:
configuration parameters name, e.g. 'weightsFile'

description

public String description()
Specified by:
description in interface Parameter<T>
Returns:
human readable description of parameters

type

public Class<T> type()
Specified by:
type in interface Parameter<T>
Returns:
value class type

defaultValue

public String defaultValue()
Specified by:
defaultValue in interface Parameter<T>
Returns:
value used if not set by consumer

get

public T get()
Specified by:
get in interface Parameter<T>
Returns:
current parameters value

set

public void set(T value)
Specified by:
set in interface Parameter<T>
Parameters:
value - new parameters value

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.