hudson.plugins.cobertura
Class Ratio

java.lang.Object
  extended by hudson.plugins.cobertura.Ratio
All Implemented Interfaces:
java.io.Serializable

public final class Ratio
extends java.lang.Object
implements java.io.Serializable

Represents x/y where x=numerator and y=denominator.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Field Summary
 float denominator
           
 float numerator
           
 
Method Summary
static Ratio create(float x, float y)
          Creates a new instance of Ratio.
 boolean equals(java.lang.Object o)
          
 int getPercentage()
          Gets the percentage in integer.
 float getPercentageFloat()
          Gets the percentage in float.
 java.lang.String getPercentageString()
          Gets the percentage as a formated string used for sorting the html table
 int hashCode()
          
 java.lang.String toString()
          Gets "x/y" representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

numerator

public final float numerator

denominator

public final float denominator
Method Detail

toString

public java.lang.String toString()
Gets "x/y" representation.

Overrides:
toString in class java.lang.Object

getPercentage

public int getPercentage()
Gets the percentage in integer.


getPercentageFloat

public float getPercentageFloat()
Gets the percentage in float. For exceptional cases of 0/0, return 100% as it corresponds to expected ammout. For error cases of x/0, return 0% as x is unexpected ammout.


getPercentageString

public java.lang.String getPercentageString()
Gets the percentage as a formated string used for sorting the html table


equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

create

public static Ratio create(float x,
                           float y)
Creates a new instance of Ratio.



Copyright © 2004-2011. All Rights Reserved.