001    /**
002     * 
003     */
004    package org.wdssii.dualpol.icing;
005    
006    import java.util.Date;
007    
008    import org.wdssii.core.Location;
009    
010    /**
011     * 
012     * A pilot report of icing conditions
013     * 
014     * @author lakshman
015     *
016     */
017    public class PilotReport {
018            private Date time;
019            private Location lowerBound;
020            private Location upperBound;
021            private Location location;
022            private int icingIntensity;
023            public PilotReport(Date time, Location lowerBound, Location upperBound,
024                            int icingIntensity) {
025                    super();
026                    this.time = time;
027                    this.lowerBound = lowerBound;
028                    this.upperBound = upperBound;
029                    // middle of the two 
030                    this.location = new Location(lowerBound.getLatitude(), lowerBound.getLongitude(), 0.5*(lowerBound.getHeightKms() + upperBound.getHeightKms()));
031                    this.icingIntensity = icingIntensity;
032            }
033            public Date getTime() {
034                    return time;
035            }
036            public Location getLowerBound() {
037                    return lowerBound;
038            }
039            public Location getUpperBound() {
040                    return upperBound;
041            }
042            public int getIcingIntensity() {
043                    return icingIntensity;
044            }
045            public Location getLocation(){
046                    return location;
047            }
048            @Override
049            public String toString(){
050                    return new StringBuilder("PilotReport: time=").append(time).append(" loc=").append(location).append(" icing=").append(icingIntensity).toString();
051            }
052    }