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

public Class FractionField

extends Object
implements Field<Fraction>, 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 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
FractionField.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
FractionField()

Private constructor for the singleton.

Method Summary

Modifier and TypeMethod and Description
public static FractionField

Returns:

the unique instance
getInstance
()

Get the unique instance.

public Fraction
getOne()

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

Get the multiplicative identity of the field.

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

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

Returns the runtime class of the FieldElement.

public Fraction
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

FractionFieldback to summary
private FractionField()

Private constructor for the singleton.

Method Detail

getInstanceback to summary
public static FractionField getInstance()

Get the unique instance.

Returns:FractionField

the unique instance

getOneback to summary
public Fraction 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:Fraction

multiplicative identity of the field

getRuntimeClassback to summary
public Class<? extends FieldElement<Fraction>> 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<Fraction>>

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

getZeroback to summary
public Fraction 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:Fraction

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 FractionField.LazyHolder

extends Object
Class Inheritance

Holder for the instance.

We use here the Initialization On Demand Holder Idiom.

Field Summary

Modifier and TypeField and Description
private static final FractionField
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 FractionField INSTANCE

Cached field instance.

Constructor Detail

LazyHolderback to summary
private LazyHolder()