Rev | Line | |
---|
[31] | 1 | /************************************************************************************ |
---|
| 2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
| 3 | * All rights reserved. |
---|
| 4 | * Refer to LICENSE for terms and conditions of use. |
---|
| 5 | ***********************************************************************************/ |
---|
| 6 | package vnsim.core.events; |
---|
| 7 | |
---|
| 8 | /** |
---|
| 9 | * Class that holds information about a simulation event. |
---|
| 10 | * |
---|
| 11 | */ |
---|
| 12 | public class Event implements Comparable<Event>{ |
---|
| 13 | int time; |
---|
| 14 | |
---|
| 15 | public Event(int time) { |
---|
| 16 | this.time = time; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | public int compareTo(Event e){ |
---|
| 20 | return time - e.time; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | public boolean equals(Object e){ |
---|
| 24 | if (!(e instanceof Event)) { |
---|
| 25 | return false; |
---|
| 26 | } |
---|
| 27 | Event ev = (Event) e; |
---|
| 28 | return time == ev.time; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | public int getTime() { |
---|
| 32 | return time; |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | public void setTime(int time) { |
---|
| 36 | this.time = time; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.