Top Description Inners Fields Constructors Methods
org.apache.commons.math3.fraction

public Class BigFractionField

extends Object
implements Field<BigFraction>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.apache.commons.math3.Field
Imports
java.io.Serializable, org.apache.commons.math3.Field, .FieldElement

Representation of the fractional numbers without any overflow field.

This class is a singleton.

Since
2.0
See Also
Fraction

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
BigFractionField.LazyHolder

Holder for the instance.

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Serializable version identifier

Constructor Summary

AccessConstructor and Description
private
BigFractionField()

Private constructor for the singleton.

Method Summary

Modifier and TypeMethod and Description
public static BigFractionField

Returns:

the unique instance
getInstance
()

Get the unique instance.

public BigFraction
getOne()

Implements org.apache.commons.math3.Field.getOne.

Get the multiplicative identity of the field.

public Class<? extends FieldElement<BigFraction>>
getRuntimeClass()

Implements org.apache.commons.math3.Field.getRuntimeClass.

Returns the runtime class of the FieldElement.

public BigFraction
getZero()

Implements org.apache.commons.math3.Field.getZero.

Get the additive identity of the field.

private Object

Returns:

the singleton instance
readResolve
()

Handle deserialization of the singleton.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Serializable version identifier

Constructor Detail

BigFractionFieldback to summary
private BigFractionField()

Private constructor for the singleton.

Method Detail

getInstanceback to summary
public static BigFractionField getInstance()

Get the unique instance.

Returns:BigFractionField

the unique instance

getOneback to summary
public BigFraction getOne()

Implements org.apache.commons.math3.Field.getOne.

Doc from org.apache.commons.math3.Field.getOne.

Get the multiplicative identity of the field.

The multiplicative identity is the element e1 of the field such that for all elements a of the field, the equalities a × e1 = e1 × a = a hold.

Returns:BigFraction

multiplicative identity of the field

getRuntimeClassback to summary
public Class<? extends FieldElement<BigFraction>> getRuntimeClass()

Implements org.apache.commons.math3.Field.getRuntimeClass.

Doc from org.apache.commons.math3.Field.getRuntimeClass.

Returns the runtime class of the FieldElement.

Returns:Class<? extends FieldElement<BigFraction>>

The Class object that represents the runtime class of this object.

getZeroback to summary
public BigFraction getZero()

Implements org.apache.commons.math3.Field.getZero.

Doc from org.apache.commons.math3.Field.getZero.

Get the additive identity of the field.

The additive identity is the element e0 of the field such that for all elements a of the field, the equalities a + e0 = e0 + a = a hold.

Returns:BigFraction

additive identity of the field

readResolveback to summary
private Object readResolve()

Handle deserialization of the singleton.

Returns:Object

the singleton instance

org.apache.commons.math3.fraction back to summary

private Class BigFractionField.LazyHolder

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.fraction.BigFractionField.LazyHolder

Holder for the instance.

We use here the Initialization On Demand Holder Idiom.

Field Summary

Modifier and TypeField and Description
private static final BigFractionField
INSTANCE

Cached field instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final BigFractionField INSTANCE

Cached field instance.

Constructor Detail

LazyHolderback to summary
private LazyHolder()