org.graphstream.algorithm
Class Parameter

java.lang.Object
  extended by org.graphstream.algorithm.Parameter

public class Parameter
extends Object

Defines a parameter as an association between a String and an Object.


Nested Class Summary
static class Parameter.ParametersProcessor
          Defines the object which will process parameters.
 
Constructor Summary
Parameter(String key, Object value)
          Build a new parameter.
 
Method Summary
 String getKey()
          Get the key of this parameter.
<T> T
getValue()
          Get the value of this parameter.
static Parameter parameter(String key, Object value)
          Shortcut for "new Parameter(key,value)".
static void processParameters(Object env, Parameter... params)
          Process parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(String key,
                 Object value)
Build a new parameter.

Parameters:
key -
value -
Method Detail

parameter

public static final Parameter parameter(String key,
                                        Object value)
Shortcut for "new Parameter(key,value)".

Parameters:
key - key of the parameter
value - value of the parameter
Returns:
new Parameter(key,value)

processParameters

public static void processParameters(Object env,
                                     Parameter... params)
                              throws InvalidParameterException,
                                     MissingParameterException
Process parameters. Throws an exception if something is wrong.

Parameters:
env - object to set attributes
params - parameters
Throws:
InvalidParameterException
MissingParameterException

getKey

public String getKey()
Get the key of this parameter.

Returns:
the key

getValue

public <T> T getValue()
Get the value of this parameter.

Type Parameters:
T - type asked for the value
Returns:
the value as a T


Copyright © 2012. All Rights Reserved.