com.tensegrity.generic.util.metric
Class MetricExpression

java.lang.Object
  extended bycom.tensegrity.generic.util.metric.MetricExpression
All Implemented Interfaces:
java.lang.Comparable

public class MetricExpression
extends java.lang.Object
implements java.lang.Comparable

The MetricExpression class represents a metric expression. A metric expression consists of a value and a certain unit and depicts a length. So the structure of a metric expression looks like:

    ValueUnit
* * * * * * * * * * * * * * * * * * * *

Version:
$Id: MetricExpression.java,v 1.4 2006/01/26 13:03:56 MichaelKegel Exp $
Author:
MKegel
See Also:
Metric, MetricConstants, MetricExpressionParser

Field Summary
 int unit
          instance variable for the length unit
 double value
          instance variable for the length value
 
Constructor Summary
MetricExpression(double value, int unit)
          Constructor with given value and unit for the length to express.
MetricExpression(MetricExpression other)
          Copy constructor.
 
Method Summary
 java.lang.Object clone()
           
 int compareTo(java.lang.Object o)
           
 MetricExpression deepCopy()
          Creates a deep copy from this instance of MetricExpression.
 boolean equals(java.lang.Object obj)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public double value
instance variable for the length value


unit

public int unit
instance variable for the length unit

Constructor Detail

MetricExpression

public MetricExpression(double value,
                        int unit)
Constructor with given value and unit for the length to express.

Parameters:
value - the value of the length
unit - the unit of the length

MetricExpression

public MetricExpression(MetricExpression other)
Copy constructor.

Parameters:
other - the MetricExpression instance to create a copy from
Method Detail

deepCopy

public MetricExpression deepCopy()
Creates a deep copy from this instance of MetricExpression.

Returns:
MetricExpression to deep copy

equals

public boolean equals(java.lang.Object obj)

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

clone

public java.lang.Object clone()

toString

public java.lang.String toString()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.