tuwien.auto.calimero.dptxlator
Class DPT

java.lang.Object
  extended by tuwien.auto.calimero.dptxlator.DPT
Direct Known Subclasses:
DPTXlator3BitControlled.DPT3BitControlled

public class DPT
extends java.lang.Object

Stores information about a datapoint type.

Besides the subtype ID of the DPT, a general description, and the unit of measure (if any), there are two additional informational values. They contain string representations of translator values. The first one should contain the string representation of a low value, if possible the lower bound of the supported value range, and the second contains a corresponding upper bound string value representation.
Even though not enforced, the preferred way for identifying a DPT is to use a datapoint type ID (dptID) value in the format "[main number].[sub number]".
Instances of this type are immutable.


Constructor Summary
DPT(java.lang.String typeID, java.lang.String description, java.lang.String lower, java.lang.String upper)
          Creates a new datapoint type information structure for a DPT without a unit.
DPT(java.lang.String typeID, java.lang.String description, java.lang.String lower, java.lang.String upper, java.lang.String unit)
          Creates a new datapoint type information structure.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDescription()
          Returns the DPT description.
 java.lang.String getID()
          Returns the DPT identifier.
 java.lang.String getLowerValue()
          Returns a lower value information.
 java.lang.String getUnit()
          Returns the unit of measure for this DPT.
 java.lang.String getUpperValue()
          Returns an upper value information.
 int hashCode()
           
 java.lang.String toString()
          Returns the DPT's information in concise textual format.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DPT

public DPT(java.lang.String typeID,
           java.lang.String description,
           java.lang.String lower,
           java.lang.String upper)
Creates a new datapoint type information structure for a DPT without a unit.

Parameters:
typeID - datapoint type identifier
description - short textual description
lower - lower value information
upper - upper value information

DPT

public DPT(java.lang.String typeID,
           java.lang.String description,
           java.lang.String lower,
           java.lang.String upper,
           java.lang.String unit)
Creates a new datapoint type information structure.

Parameters:
typeID - datapoint type identifier
description - short textual description
lower - lower value information
upper - upper value information
unit - unit of measure, use "" or null for no unit
Method Detail

equals

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

getDescription

public final java.lang.String getDescription()
Returns the DPT description.

Returns:
description as string

getID

public final java.lang.String getID()
Returns the DPT identifier.

Returns:
ID as string

getLowerValue

public final java.lang.String getLowerValue()
Returns a lower value information.

The value either contains a string value representation of some lower bound in the value range of this DPT, or a more general DPT encoding range information if practicable.

Returns:
lower value as string

getUnit

public final java.lang.String getUnit()
Returns the unit of measure for this DPT.

Returns:
unit as string, the empty string for no unit

getUpperValue

public final java.lang.String getUpperValue()
Returns an upper value information.

It contains an upper value representation in the value range for this DPT. The corresponding method getLowerValue() should contain the lower bound value then.
If no information about an upper value can be given, a DPT might set this information optional, and the empty string is returned.

Returns:
value as string, or the empty string

hashCode

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

toString

public java.lang.String toString()
Returns the DPT's information in concise textual format.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the DPT