source: Dev/LoggingTool/models/TeamUpEvent.cs @ 384

Last change on this file since 384 was 5, checked in by jkraaijeveld, 14 years ago
File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Globalization;
6
7namespace 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}
Note: See TracBrowser for help on using the repository browser.