Class PrefixTable
Represents a table of unit prefixes, indicating multiples or submultiples of a base unit.
public abstract class PrefixTable : IEquatable<IUnit>, IEnumerable<IPrefixUnit>, IEnumerable
- Inheritance
-
PrefixTable
- Implements
- Derived
- Extension Methods
Constructors
PrefixTable(IUnit)
Initializes a new instance of the PrefixTable class.
protected PrefixTable(IUnit unit)
Parameters
Exceptions
- ArgumentNullException
unit
cannot be null.
Properties
BaseUnit
Gets the base unit of this table.
public IUnit BaseUnit { get; }
Property Value
- IUnit
The base unit of this table.
Methods
Equals(IUnit)
Indicates whether the current object is equal to another object of the same type.
public virtual bool Equals(IUnit other)
Parameters
other
IUnitAn object to compare with this object.
Returns
- bool
true
if the current object is equal to theother
parameter; otherwise,false
.
Equals(object)
Determines whether the specified Object is equal to this instance.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetEnumerator()
Returns an enumerator that iterates through the multiples and/or submultiples of the base unit.
public abstract IEnumerator<IPrefixUnit> GetEnumerator()
Returns
- IEnumerator<IPrefixUnit>
An enumerator that can be used to iterate through multiples and/or submultiples of the base unit.
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Returns a string that represents largest metric-multiple prefix of this instance.
public override string ToString()
Returns
Remarks
Evaluates the largest metric-multiple prefix that is greater or equal to 1 and returns that as either Binary or Decimal formatted.
Operators
implicit operator double(PrefixTable)
Performs an implicit conversion from PrefixTable to double.
public static implicit operator double(PrefixTable mt)
Parameters
mt
PrefixTableThe PrefixTable to convert.