Android Open Source - android-nfl-passer-rating Abstract Passer Rating






From Project

Back to project page android-nfl-passer-rating.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project android-nfl-passer-rating listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * This is free and unencumbered software released into the public domain.
 * //  ww w. j  a va  2 s.  c  o m
 * Anyone is free to copy, modify, publish, use, compile, sell, or
 * distribute this software, either in source code form or as a compiled
 * binary, for any purpose, commercial or non-commercial, and by any
 * means.
 * 
 * In jurisdictions that recognize copyright laws, the author or authors
 * of this software dedicate any and all copyright interest in the
 * software to the public domain. We make this dedication for the benefit
 * of the public at large and to the detriment of our heirs and
 * successors. We intend this dedication to be an overt act of
 * relinquishment in perpetuity of all present and future rights to this
 * software under copyright law.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 * 
 * For more information, please refer to <http://unlicense.org/>
 */

package com.github.pffy.sports;

/**
 * Abstract class describes the basic components of various passer ratings.
 * @author The Pffy Authors
 * 
 */
abstract public class AbstractPasserRating {

  protected double completedPasses;
  protected double attemptedPasses;
  protected double yardsPassing;
  protected double touchdownPasses;
  protected double interceptedPasses;
  
  abstract protected double getRating();
 
  @Override
  public String toString() {
    return "" + this.getRating();
  }
  
  /**
   * Returns the number of completed passes.
   * @return the completedPasses 
   */
  public final double getCompletedPasses() {
    return completedPasses;
  }

  
  /**
   * Sets the number of completed passes.
   * @param completedPasses the completedPasses to set
   */
  public final void setCompletedPasses(double completedPasses) {
    this.completedPasses = completedPasses;
  }

  
  /**
   * Returns the number of attempted passes.
   * @return the attemptedPasses
   */
  public final double getAttemptedPasses() {
    return attemptedPasses;
  }

  
  /**
   * Sets the number of attempted passes.
   * @param attemptedPasses the attemptedPasses to set
   */
  public final void setAttemptedPasses(double attemptedPasses) {
    this.attemptedPasses = attemptedPasses;
  }

  
  /**
   * Returns the number of yards passing.
   * @return the yardsPassing
   */
  public final double getYardsPassing() {
    return yardsPassing;
  }

  
  /**
   * Set the number of yards passing.
   * @param yardsPassing the yardsPassing to set
   */
  public final void setYardsPassing(double yardsPassing) {
    this.yardsPassing = yardsPassing;
  }

  
  /**
   * Returns the number of touchdown passes.
   * @return the touchdownPasses
   */
  public final double getTouchdownPasses() {
    return touchdownPasses;
  }

  /**
   * Sets the number of touchdown passes.
   * @param touchdownPasses the touchdownPasses to set
   */
  public final void setTouchdownPasses(double touchdownPasses) {
    this.touchdownPasses = touchdownPasses;
  }

  /**
   * Returns the number of intercepted passes.
   * @return the interceptedPasses
   */
  public final double getInterceptedPasses() {
    return interceptedPasses;
  }

  /**
   * Sets the number of Intercepted passes.
   * @param interceptedPasses the interceptedPasses to set
   */
  public final void setInterceptedPasses(double interceptedPasses) {
    this.interceptedPasses = interceptedPasses;
  }
}




Java Source Code List

com.github.pffy.qbrating.PasserRatingActivity.java
com.github.pffy.sports.AbstractPasserRating.java
com.github.pffy.sports.AflPasserRating.java
com.github.pffy.sports.NcaaPasserRating.java
com.github.pffy.sports.NflPasserRating.java