DESY ACOP Beans Home

com.cosylab.gui.displayers
Class DisplayerParameters

java.lang.Object
  extended by com.cosylab.gui.displayers.DisplayerParameters
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AcopDisplayerParameters

public class DisplayerParameters
extends java.lang.Object
implements java.io.Serializable

DisplayerParameters holds various properties of some displayed value. These properties can be anything that specify a displayable value (Color, name etc) and should also hold information about remote connection that displayed value is referred to. DisplayerParameters is a serializable object.

Author:
Jaka Bobnar, Cosylab
See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  java.lang.String[] names
           
protected  java.util.Map<java.lang.String,java.lang.Object> values
           
 
Constructor Summary
  DisplayerParameters(java.lang.String name)
          Creates new instance of DisplayerParameters.
  DisplayerParameters(java.lang.String name, DoubleDisplayer disp)
          Constructs new DisplayerParameters with the given name.
  DisplayerParameters(java.lang.String name, double min, double max, java.lang.String units, java.lang.String format)
          Constructs new DisplayerParameters with the given values.
  DisplayerParameters(java.lang.String name, int size)
          Creates new instance of DisplayerParameters.
protected DisplayerParameters(java.lang.String name, int size, DoubleDisplayer disp)
           
protected DisplayerParameters(java.lang.String name, int size, double min, double max, java.lang.String units, java.lang.String format)
           
protected DisplayerParameters(java.lang.String name, java.util.List<java.lang.String> names, java.util.List values)
          Creates new instance of DisplayerParameters.
  DisplayerParameters(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> values)
          Constructs new DisplayerParameters with the given name and values listed in the Map.
protected DisplayerParameters(java.lang.String name, java.lang.String[] names, java.lang.Object[] values)
          Creates new instance of DisplayerParameters.
 
Method Summary
 java.lang.Object addParameter(java.lang.String name, java.lang.Object value)
          Adds a parameter with the given name.
 int count()
          Returns the number of all parameters.
 boolean equals(java.lang.Object o)
           
protected  boolean getBool(java.lang.String name)
           
protected  double getDouble(java.lang.String name)
           
 java.lang.String getFormat()
           
protected  int getInt(java.lang.String name)
           
 double getMaximum()
           
 double getMinimum()
           
 java.lang.String getName()
          Returns the name.
 java.lang.String[] getNames()
          Returns the names of all parameters.
 java.lang.Object getParameter(java.lang.String name)
          Returns the parameter under the given name.
 java.lang.String getUnits()
           
 java.lang.Object[] getValues()
          Returns the values of all parameters
 int hashCode()
           
 java.lang.Object putParameter(java.lang.String name, java.lang.Object value)
          Puts a parameter under the given name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

names

protected transient java.lang.String[] names

values

protected transient java.util.Map<java.lang.String,java.lang.Object> values
Constructor Detail

DisplayerParameters

public DisplayerParameters(java.lang.String name)
Creates new instance of DisplayerParameters.


DisplayerParameters

public DisplayerParameters(java.lang.String name,
                           int size)
Creates new instance of DisplayerParameters.


DisplayerParameters

protected DisplayerParameters(java.lang.String name,
                              java.util.List<java.lang.String> names,
                              java.util.List values)
Creates new instance of DisplayerParameters.


DisplayerParameters

protected DisplayerParameters(java.lang.String name,
                              java.lang.String[] names,
                              java.lang.Object[] values)
Creates new instance of DisplayerParameters.


DisplayerParameters

protected DisplayerParameters(java.lang.String name,
                              int size,
                              double min,
                              double max,
                              java.lang.String units,
                              java.lang.String format)

DisplayerParameters

protected DisplayerParameters(java.lang.String name,
                              int size,
                              DoubleDisplayer disp)

DisplayerParameters

public DisplayerParameters(java.lang.String name,
                           DoubleDisplayer disp)
Constructs new DisplayerParameters with the given name. The rest of the parameters will be extracted from the displayer.

Parameters:
name - the name paramete
disp - source of parameters

DisplayerParameters

public DisplayerParameters(java.lang.String name,
                           double min,
                           double max,
                           java.lang.String units,
                           java.lang.String format)
Constructs new DisplayerParameters with the given values.

Parameters:
name -
min -
max -
units -
format -

DisplayerParameters

public DisplayerParameters(java.lang.String name,
                           java.util.Map<java.lang.String,java.lang.Object> values)
Constructs new DisplayerParameters with the given name and values listed in the Map.

Parameters:
name - the name parameter
values - optional parameters
Method Detail

addParameter

public java.lang.Object addParameter(java.lang.String name,
                                     java.lang.Object value)
Adds a parameter with the given name.

Parameters:
name - the name of the parameter
value - the parameter
Returns:
previous value under the given name

putParameter

public java.lang.Object putParameter(java.lang.String name,
                                     java.lang.Object value)
Puts a parameter under the given name. This method does not trigger refresh of the parameters names.

Parameters:
name - the name of the parameter
value - the replacement parameter
Returns:
the previous parameter under the given name

getParameter

public java.lang.Object getParameter(java.lang.String name)
Returns the parameter under the given name.

Parameters:
name - the name of the parameter
Returns:
the parameter

getName

public java.lang.String getName()
Returns the name.

Returns:
Returns the name.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFormat

public java.lang.String getFormat()
Returns:
the format

getMaximum

public double getMaximum()
Returns:
the maximum

getMinimum

public double getMinimum()
Returns:
the minimum

getDouble

protected double getDouble(java.lang.String name)

getInt

protected int getInt(java.lang.String name)

getBool

protected boolean getBool(java.lang.String name)

getUnits

public java.lang.String getUnits()
Returns:
the units

getNames

public java.lang.String[] getNames()
Returns the names of all parameters.

Returns:

getValues

public java.lang.Object[] getValues()
Returns the values of all parameters

Returns:

count

public int count()
Returns the number of all parameters.

Returns:

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2010. All Rights Reserved.