/*
 * PauseType.java
 *
 * Created on May 19, 2005, 2:02 PM
 */

package DDMT.core.misc;

/**
 *
 * @author  jk3
 */
public class PauseType implements EventType {
    
    //The node that this message was printed from
    int nodeNumber;
    
    //The length of the pause
    double pause;
    
    //The time that the message was printed out
    double time;
    
    /** Creates a new instance of UserType */
    public PauseType( int n, double pause, double T) {
        nodeNumber = n;
        time = T;
    }
    
    /** Check if the event happens during this time period **/
    public boolean involves(int number) {
        if( number == nodeNumber)
            return true;
        return false;
    }
    
    public String print() {
        return "Time: "+time+" Node "+nodeNumber+" paused for "+pause+" time units.";
    }
    
    public boolean happenedDuring(double startTime, double endTime) {
        if( time < endTime && time > startTime )
            return true;
        return false;
    }
    
    public int Compare(EventType event) {
        if( event.getTime() > time)
        {
            return -1;
        }else
        {
            return 1;
        }
    }
    
    public double getTime() {
        return this.time;
    }
    
}