public sealed class Fraction : IMessage<Fraction>, IEquatable<Fraction>, IDeepCloneable<Fraction>, IBufferMessage, IMessage
Represents a fraction in terms of a numerator divided by a denominator.
Implements
IMessage Fraction , IEquatable Fraction , IDeepCloneable Fraction , IBufferMessage , IMessageNamespace
Google.TypeAssembly
Google.Api.CommonProtos.dll
Constructors
Fraction()
public Fraction()
Fraction(Fraction)
public Fraction(Fraction other)
Fields
DenominatorFieldNumber
public
const
int
DenominatorFieldNumber
=
2
Field number for the "denominator" field.
NumeratorFieldNumber
public
const
int
NumeratorFieldNumber
=
1
Field number for the "numerator" field.
Properties
Denominator
public long Denominator { get; set; }
The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.
Descriptor
public static MessageDescriptor Descriptor { get; }
Numerator
public long Numerator { get; set; }
The numerator in the fraction, e.g. 2 in 2/3.
Parser
public static MessageParser<Fraction> Parser { get; }
Methods
CalculateSize()
public int CalculateSize()
Calculates the size of this message in Protocol Buffer wire format, in bytes.
The number of bytes required to write this message to a coded output stream.
Clone()
public Fraction Clone()
Creates a deep clone of this object.
Equals(Fraction)
public bool Equals(Fraction other)
Equals(object)
public override bool Equals(object other)
GetHashCode()
public override int GetHashCode()
MergeFrom(CodedInputStream)
public void MergeFrom(CodedInputStream input)
Merges the data from the specified coded input stream with the current message.
See the user guide for precise merge semantics.
MergeFrom(Fraction)
public void MergeFrom(Fraction other)
Merges the given message into this one.
See the user guide for precise merge semantics.
ToString()
public override string ToString()
WriteTo(CodedOutputStream)
public void WriteTo(CodedOutputStream output)
Writes the data to the given coded output stream.
output