org.knime.base.node.viz.aggregation
Enum ValueScale

java.lang.Object
  extended by java.lang.Enum<ValueScale>
      extended by org.knime.base.node.viz.aggregation.ValueScale
All Implemented Interfaces:
Serializable, Comparable<ValueScale>, ButtonGroupEnumInterface

public enum ValueScale
extends Enum<ValueScale>
implements ButtonGroupEnumInterface

Enumeration of different value scales.

Author:
Tobias Koetter, University of Konstanz

Enum Constant Summary
ORIGINAL
          The original scaling.
PERCENT
          Percentage scaling.
 
Method Summary
 String getActionCommand()
          Should return the ButtonGroup wide unique action command.
static ValueScale getDefaultMethod()
           
 String getExtension()
           
static ValueScale getScale4Command(String action)
          Returns the scale for the given action command.
 String getText()
          
 String getToolTip()
          
 boolean isDefault()
          
 double scale(double value, double totalValue)
           
static ValueScale valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ValueScale[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ORIGINAL

public static final ValueScale ORIGINAL
The original scaling.


PERCENT

public static final ValueScale PERCENT
Percentage scaling.

Method Detail

values

public static ValueScale[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ValueScale c : ValueScale.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ValueScale valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getActionCommand

public String getActionCommand()
Should return the ButtonGroup wide unique action command. This is typically the return value of the Enum.name() method.

Specified by:
getActionCommand in interface ButtonGroupEnumInterface
Returns:
the unique action command of this option

getText

public String getText()

Specified by:
getText in interface ButtonGroupEnumInterface
Returns:
the text to display

getToolTip

public String getToolTip()

Specified by:
getToolTip in interface ButtonGroupEnumInterface
Returns:
the tool tip of this option could be null

getExtension

public String getExtension()
Returns:
the optional value scale extension

getDefaultMethod

public static ValueScale getDefaultMethod()
Returns:
the default scale

isDefault

public boolean isDefault()

Specified by:
isDefault in interface ButtonGroupEnumInterface
Returns:
true if this is the default option

scale

public double scale(double value,
                    double totalValue)
Parameters:
value - the value to scale
totalValue - the total value used to calculate percentage
Returns:
the scaled value

getScale4Command

public static ValueScale getScale4Command(String action)
Returns the scale for the given action command. If the command is null or has length zero the method returns the default scale.

Parameters:
action - the action command to check
Returns:
the aggregation method with the given name


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.