1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Globalization;
|
---|
6 |
|
---|
7 | namespace LoggingTool.models
|
---|
8 | {
|
---|
9 | class TeamUpEvent
|
---|
10 | {
|
---|
11 | private double timestamp;
|
---|
12 | private int eventID;
|
---|
13 | /* ******************************************************************************
|
---|
14 | * constructor TeamUpEvent
|
---|
15 | * @description: creates a TeamUpEvent object out of the raw input String
|
---|
16 | * ******************************************************************************/
|
---|
17 | public TeamUpEvent(String rawInput)
|
---|
18 | {
|
---|
19 | //Split the inputstring on |, the delimiter used in the input format
|
---|
20 | String[] splitInput = rawInput.Split('|');
|
---|
21 | timestamp = double.Parse(splitInput[0]);
|
---|
22 | eventID = int.Parse(splitInput[2]);
|
---|
23 | }
|
---|
24 |
|
---|
25 |
|
---|
26 | /* ******************************************************************************
|
---|
27 | * function toString
|
---|
28 | * @return: String
|
---|
29 | * @description: Returns a string representation of the TeamUpEvent object
|
---|
30 | * ******************************************************************************/
|
---|
31 | public String toString()
|
---|
32 | {
|
---|
33 | String res = "Timestamp :" + timestamp + "\n";
|
---|
34 | res = res + "EventID :" + eventID;
|
---|
35 | return res;
|
---|
36 | }
|
---|
37 |
|
---|
38 |
|
---|
39 | /* ******************************************************************************
|
---|
40 | * function toStringArray
|
---|
41 | * @return: List<String>
|
---|
42 | * @description: Returns a String array containing the information of the TeamUpEvent object
|
---|
43 | * ******************************************************************************/
|
---|
44 | public List<String> toStringArray()
|
---|
45 | {
|
---|
46 | return new List<String>() { timestamp.ToString(), eventID.ToString() };
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|