public class Metric extends Object implements Serializable
Constructor and Description |
---|
Metric(String name,
String symbol)
Class constructor specifying name and symbol.
|
Metric(String name,
String symbol,
String definition)
Class constructor specifying name, symbol and definition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares this
Metric to obj . |
String |
getDefinition()
Returns the String containing the definition of this metric.
|
String |
getName()
Returns the name of this metric.
|
String |
getSymbol()
Returns the symbol of this metric.
|
int |
hashcode()
Returns a hash code for this
Metric object. |
int |
hashCode() |
String |
toString()
Returns a string representation of this
Metric object. |
public Metric(String name, String symbol, String definition)
name
- the name of the metric, for example 'meter'symbol
- symbol used to represent the metric, for example 'm'definition
- definition of the metric, i.e. 'the base unit of length in the International System of Units'public String getName()
public String getSymbol()
public String getDefinition()
public boolean equals(Object obj)
Metric
to obj
. Returns false if obj
is not an instance of
Metric
. Otherwise, two Metric
s are equal, if their symbols and names are equal.public final int hashcode()
Metric
object. The result is exclusive OR of the hash code of the name
and the hash code of the symbol.Metric
object.Copyright © 2014 Pivotal Software, Inc.. All rights reserved.