Class Fraction
Represents a fraction in terms of a numerator divided by a denominator.
Inheritance
System.Object
Fraction
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class Fraction : IMessage<Fraction>, IMessage, IEquatable<Fraction>, IDeepCloneable<Fraction>
Constructors
Fraction()
Declaration
Fraction(Fraction)
Declaration
public Fraction(Fraction other)
Parameters
Fields
DenominatorFieldNumber
Field number for the "denominator" field.
Declaration
public const int DenominatorFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
NumeratorFieldNumber
Field number for the "numerator" field.
Declaration
public const int NumeratorFieldNumber = 1
Field Value
Type |
Description |
System.Int32 |
|
Properties
Denominator
The value by which the numerator is divided, e.g. 3 in 2/3. Must be
positive.
Declaration
public long Denominator { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Numerator
The portion of the denominator in the faction, e.g. 2 in 2/3.
Declaration
public long Numerator { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
Parser
Declaration
public static MessageParser<Fraction> Parser { get; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
Returns
Implements
Equals(Fraction)
Declaration
public bool Equals(Fraction other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(Fraction)
Declaration
public void MergeFrom(Fraction other)
Parameters
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements