1 |
cdf3c217
|
A-Konig
|
//
|
2 |
|
|
// Author: A. Konig
|
3 |
|
|
//
|
4 |
|
|
|
5 |
|
|
using ServerApp.Parser.OutputInfo;
|
6 |
ce0940b5
|
Roman Kalivoda
|
using System;
|
7 |
cdf3c217
|
A-Konig
|
using System.Collections.Generic;
|
8 |
|
|
|
9 |
|
|
namespace ServerApp.WeatherPredictionParser
|
10 |
|
|
{
|
11 |
|
|
/// <summary>
|
12 |
|
|
/// Abstract class that every Json parser should inherit from
|
13 |
|
|
/// </summary>
|
14 |
ce0940b5
|
Roman Kalivoda
|
public abstract class IJsonParser
|
15 |
cdf3c217
|
A-Konig
|
{
|
16 |
|
|
|
17 |
|
|
/// <summary> Current weather </summary>
|
18 |
|
|
WeatherInfo current;
|
19 |
ce0940b5
|
Roman Kalivoda
|
public WeatherInfo Current { get => current; set => current = value; }
|
20 |
cdf3c217
|
A-Konig
|
|
21 |
|
|
/// <summary> Prediction for today, tommorrow and day after tommorrow </summary>
|
22 |
|
|
List<WeatherInfo> predictions;
|
23 |
|
|
public List<WeatherInfo> Predictions { get => predictions; set => predictions = value; }
|
24 |
|
|
|
25 |
|
|
/// <summary>
|
26 |
|
|
/// Parse weather prediction
|
27 |
|
|
/// Results is in attributes current for current weather and pred for weather prediction for today, tommorrow and day after tommorrow
|
28 |
|
|
/// </summary>
|
29 |
|
|
abstract public void ParsePrediction();
|
30 |
|
|
|
31 |
ce0940b5
|
Roman Kalivoda
|
/// <summary>
|
32 |
|
|
/// Get predictions from Predictions that are within specified time span
|
33 |
|
|
/// </summary>
|
34 |
|
|
/// <param name="from">DateTime from</param>
|
35 |
|
|
/// <param name="to">DateTime to</param>
|
36 |
|
|
/// <returns>List of predictions that fit specified criteria</returns>
|
37 |
|
|
abstract public List<WeatherInfo> GetPredictionForTime(DateTime from, DateTime to);
|
38 |
|
|
|
39 |
cdf3c217
|
A-Konig
|
}
|
40 |
|
|
|
41 |
|
|
}
|