Class Fraction (2.37.1)

public final class Fraction extends GeneratedMessageV3 implements FractionOrBuilder

Represents a fraction in terms of a numerator divided by a denominator.

Protobuf type google.type.Fraction

Implements

FractionOrBuilder

Static Fields

DENOMINATOR_FIELD_NUMBER

public static final int DENOMINATOR_FIELD_NUMBER
Field Value
TypeDescription
int

NUMERATOR_FIELD_NUMBER

public static final int NUMERATOR_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Fraction getDefaultInstance()
Returns
TypeDescription
Fraction

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Fraction.Builder newBuilder()
Returns
TypeDescription
Fraction.Builder

newBuilder(Fraction prototype)

public static Fraction.Builder newBuilder(Fraction prototype)
Parameter
NameDescription
prototypeFraction
Returns
TypeDescription
Fraction.Builder

parseDelimitedFrom(InputStream input)

public static Fraction parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Fraction parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Fraction parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Fraction parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Fraction parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Fraction parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Fraction parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Fraction parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Fraction parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Fraction parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Fraction parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Fraction parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Fraction
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Fraction> parser()
Returns
TypeDescription
Parser<Fraction>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Fraction getDefaultInstanceForType()
Returns
TypeDescription
Fraction

getDenominator()

public long getDenominator()

The value by which the numerator is divided, e.g. 3 in 2/3. Must be positive.

int64 denominator = 2;

Returns
TypeDescription
long

The denominator.

getNumerator()

public long getNumerator()

The numerator in the fraction, e.g. 2 in 2/3.

int64 numerator = 1;

Returns
TypeDescription
long

The numerator.

getParserForType()

public Parser<Fraction> getParserForType()
Returns
TypeDescription
Parser<Fraction>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Fraction.Builder newBuilderForType()
Returns
TypeDescription
Fraction.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Fraction.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Fraction.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Fraction.Builder toBuilder()
Returns
TypeDescription
Fraction.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException