org.gstreamer
Class Fraction

java.lang.Object
  extended by org.gstreamer.Fraction

public class Fraction
extends java.lang.Object

Represents a fraction value.


Field Summary
 int denominator
           
 int numerator
           
 
Constructor Summary
Fraction(int numerator, int denominator)
          Creates a new Fraction.
 
Method Summary
 int getDenominator()
          Gets the denominator of the Fraction
 int getNumerator()
          Gets the numerator of the Fraction
static Fraction objectFor(GValueAPI.GValue value)
           
 double toDouble()
          Returns the fraction as a floating point value (numerator divided by the denominator).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numerator

public final int numerator

denominator

public final int denominator
Constructor Detail

Fraction

public Fraction(int numerator,
                int denominator)
Creates a new Fraction.

Parameters:
numerator - the numerator value.
denominator - the denominator value.
Method Detail

getNumerator

public int getNumerator()
Gets the numerator of the Fraction

Returns:
the numerator as an integer.

getDenominator

public int getDenominator()
Gets the denominator of the Fraction

Returns:
the denominator as an integer.

toDouble

public double toDouble()
Returns the fraction as a floating point value (numerator divided by the denominator).

Returns:
fraction as a double, or Double.NaN if the denominator is 0

objectFor

public static Fraction objectFor(GValueAPI.GValue value)