Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package model;
- /**
- *
- * @author mga
- */
- public class YearData {
- /**
- * @return the year
- */
- public String getYear() {
- return year;
- }
- /**
- * @param year the year to set
- */
- public void setYear(String year) {
- this.year = year;
- }
- /**
- * @return the precipitation
- */
- public float getPrecipitation() {
- return precipitation;
- }
- /**
- * @param precipitation the precipitation to set
- */
- public void setPrecipitation(float precipitation) {
- this.precipitation = precipitation;
- }
- /**
- * @return the maxTemp
- */
- public int getMaxTemp() {
- return maxTemp;
- }
- /**
- * @param maxTemp the maxTemp to set
- */
- public void setMaxTemp(int maxTemp) {
- this.maxTemp = maxTemp;
- }
- /**
- * @return the minTemp
- */
- public int getMinTemp() {
- return minTemp;
- }
- /**
- * @param minTemp the minTemp to set
- */
- public void setMinTemp(int minTemp) {
- this.minTemp = minTemp;
- }
- /**
- * @return the windSpeed
- */
- public int getWindSpeed() {
- return windSpeed;
- }
- /**
- * @param windSpeed the windSpeed to set
- */
- public void setWindSpeed(int windSpeed) {
- this.windSpeed = windSpeed;
- }
- /**
- * @return the windDirection
- */
- public String getWindDirection() {
- return windDirection;
- }
- /**
- * @param windDirection the windDirection to set
- */
- public void setWindDirection(String windDirection) {
- this.windDirection = windDirection;
- }
- /**
- * @return the EOLN
- */
- public static char getEOLN() {
- return EOLN;
- }
- /**
- * @return the QUOTE
- */
- public static String getQUOTE() {
- return QUOTE;
- }
- private String year;
- private float precipitation;
- private int maxTemp;
- private int minTemp;
- private int windSpeed;
- private String windDirection;
- private static final char EOLN='\n';
- private static final String QUOTE="\"";
- public YearData() {
- this.year = "TBC";
- this.precipitation = 0;
- this.maxTemp = 0;
- this.minTemp = 0;
- this.windSpeed = 0;
- this.windDirection = "TBC";
- }
- public YearData(String year, float precipitation, int maxTemp, int minTemp, int windSpeed, String windDirection) {
- this.year = year;
- this.precipitation = precipitation;
- this.maxTemp = maxTemp;
- this.minTemp = minTemp;
- this.windSpeed = windSpeed;
- this.windDirection = windDirection;
- }
- // Methods required: getters, setters
- @Override
- public String toString() {
- return "YearData{" + "year=" + getYear() + ", precipitation=" + getPrecipitation() + ", maxTemp=" + getMaxTemp() + ", minTemp=" + getMinTemp() + ", windSpeed=" + getWindSpeed() + ", windDirection=" + getWindDirection() + '}';
- }
- public String toString(char delimiter) {
- String output=
- this.year+delimiter+QUOTE+
- this.precipitation+delimiter+QUOTE+
- this.maxTemp+delimiter+QUOTE+
- this.minTemp+delimiter+QUOTE+
- this.windSpeed+delimiter+QUOTE+
- this.windDirection+delimiter;
- output+=EOLN;
- System.out.println("output is"+output);
- return output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement