Klasse Ratio

java.lang.Object
io.jenkins.plugins.coverage.targets.Ratio
Alle implementierten Schnittstellen:
Serializable

public final class Ratio extends Object implements Serializable
Represents x/y where x=numerator and y=denominator.
Autor:
Kohsuke Kawaguchi
Siehe auch:
  • Felddetails

    • NULL

      public static final Ratio NULL
      Null Object.
    • numerator

      public final float numerator
    • denominator

      public final float denominator
  • Methodendetails

    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • getPercentage

      public int getPercentage()
      Gets the percentage in integer. If float percentage is less than 100 and larger than 95.5, then return rounded down value, else return rounded off value
      Gibt zurück:
      percentage
    • 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.
      Gibt zurück:
      percentage
    • getPercentageString

      public String getPercentageString()
      Gets the percentage as a formatted string used for sorting the html table. If float percentage is less than 100 and larger than 99.995, then return rounded down value, else return rounded off value.
      Gibt zurück:
      percentage
    • equals

      public boolean equals(Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • create

      public static Ratio create(float x, float y)
      Creates a new instance of Ratio.
      Parameter:
      x - numerator
      y - denominator
      Gibt zurück:
      the ratio