FreeHEP API
Version v1.2.2

hep.graphics.heprep.ref
Class DefaultHepRepAttValue

java.lang.Object
  |
  +--hep.graphics.heprep.ref.DefaultHepRepAttValue
All Implemented Interfaces:
HepRepAttValue, HepRepConstants, Serializable

public class DefaultHepRepAttValue
extends Object
implements HepRepAttValue, Serializable

Version:
$Id: DefaultHepRepAttValue.java,v 1.31 2003/12/09 21:07:38 duns Exp $
Author:
M.Donszelmann
See Also:
Serialized Form

Field Summary
static String cvsId
           
 
Fields inherited from interface hep.graphics.heprep.HepRepConstants
SHOW_DESC, SHOW_EXTRA, SHOW_NAME, SHOW_NONE, SHOW_VALUE, TYPE_BOOLEAN, TYPE_COLOR, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_UNKNOWN
 
Constructor Summary
DefaultHepRepAttValue(String name, boolean value, int showLabel)
           
DefaultHepRepAttValue(String name, Color value, int showLabel)
           
DefaultHepRepAttValue(String name, double value, int showLabel)
           
DefaultHepRepAttValue(String name, int value, int showLabel)
           
DefaultHepRepAttValue(String name, long value, int showLabel)
           
DefaultHepRepAttValue(String name, String value, int showLabel)
           
DefaultHepRepAttValue(String name, String value, String type, int showLabel)
           
 
Method Summary
 HepRepAttValue copy()
          Returns a deep copy of this attvalue.
 boolean equals(Object o)
           
 String getAsString()
          Returns value as string.
static String getAsString(HepRepAttValue attValue)
           
 boolean getBoolean()
          Returns value as boolean.
 Color getColor()
          Returns value as Color.
 double getDouble()
          Returns value as double.
 int getInteger()
          Returns value as int.
 long getLong()
          Returns value as long.
 String getLowerCaseName()
          Returns lowercased name of the attvalue.
 String getLowerCaseString()
          Returns value as lowercase string.
 String getName()
          Returns name of the attvalue.
 String getString()
          Returns value as string.
 int getType()
          Returns type of the attvalue, defined in HepRepConstants with names TYPE_xxx.
 String getTypeName()
          Returns the Java-like name for the type of this attvalue.
static String guessTypeFromName(String name, String type)
          A utility method which determines the appropriate type for the given name.
 int hashCode()
           
 int showLabel()
          Returns the flag bits for showing this attvalue as a label, defined in HepRepConstants with names SHOW_xxx.
static String toShowLabel(int showLabel)
           
static int toShowLabel(String labelString)
           
 String toString()
           
static String toString(int type)
           
static int toType(String type)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cvsId

public static final String cvsId
See Also:
Constant Field Values
Constructor Detail

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             String value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             Color value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             long value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             int value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             double value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             boolean value,
                             int showLabel)

DefaultHepRepAttValue

public DefaultHepRepAttValue(String name,
                             String value,
                             String type,
                             int showLabel)
Method Detail

copy

public HepRepAttValue copy()
                    throws CloneNotSupportedException
Description copied from interface: HepRepAttValue
Returns a deep copy of this attvalue.

Specified by:
copy in interface HepRepAttValue
Returns:
copy of this attvalue.
Throws:
CloneNotSupportedException - if copying is not possible.

getName

public String getName()
Description copied from interface: HepRepAttValue
Returns name of the attvalue.

Specified by:
getName in interface HepRepAttValue
Returns:
Capitalized Name.

getLowerCaseName

public String getLowerCaseName()
Description copied from interface: HepRepAttValue
Returns lowercased name of the attvalue.

Specified by:
getLowerCaseName in interface HepRepAttValue
Returns:
Lowercased Name.

getType

public int getType()
Description copied from interface: HepRepAttValue
Returns type of the attvalue, defined in HepRepConstants with names TYPE_xxx.

Specified by:
getType in interface HepRepAttValue
Returns:
type.

getTypeName

public String getTypeName()
Description copied from interface: HepRepAttValue
Returns the Java-like name for the type of this attvalue.

Specified by:
getTypeName in interface HepRepAttValue
Returns:
type name.

toShowLabel

public static int toShowLabel(String labelString)

toShowLabel

public static String toShowLabel(int showLabel)

toString

public static String toString(int type)

toType

public static int toType(String type)
Returns:
code for type or -1 if unknown

guessTypeFromName

public static String guessTypeFromName(String name,
                                       String type)
A utility method which determines the appropriate type for the given name.


showLabel

public int showLabel()
Description copied from interface: HepRepAttValue
Returns the flag bits for showing this attvalue as a label, defined in HepRepConstants with names SHOW_xxx.

Specified by:
showLabel in interface HepRepAttValue
Returns:
flag bits if should be shown as label.

getString

public String getString()
                 throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as string.

Specified by:
getString in interface HepRepAttValue
Returns:
value as string (if type is string).
Throws:
HepRepTypeException - if type is not string.

getLowerCaseString

public String getLowerCaseString()
                          throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as lowercase string.

Specified by:
getLowerCaseString in interface HepRepAttValue
Returns:
value as string (if type is string).
Throws:
HepRepTypeException - if type is not string.

getColor

public Color getColor()
               throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as Color.

Specified by:
getColor in interface HepRepAttValue
Returns:
value as Color.
Throws:
HepRepTypeException - if type is not Color.

getLong

public long getLong()
             throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as long.

Specified by:
getLong in interface HepRepAttValue
Returns:
value as long.
Throws:
HepRepTypeException - if type is not long.

getInteger

public int getInteger()
               throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as int.

Specified by:
getInteger in interface HepRepAttValue
Returns:
value as integer.
Throws:
HepRepTypeException - if type is not int.

getDouble

public double getDouble()
                 throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as double.

Specified by:
getDouble in interface HepRepAttValue
Returns:
value as double.
Throws:
HepRepTypeException - if type is not double.

getBoolean

public boolean getBoolean()
                   throws HepRepTypeException
Description copied from interface: HepRepAttValue
Returns value as boolean.

Specified by:
getBoolean in interface HepRepAttValue
Returns:
value as boolean.
Throws:
HepRepTypeException - if type is not boolean.

getAsString

public String getAsString()
Description copied from interface: HepRepAttValue
Returns value as string.

Specified by:
getAsString in interface HepRepAttValue
Returns:
value (of any type) in string format.

getAsString

public static String getAsString(HepRepAttValue attValue)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.