⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 command.java

📁 The Java Network Simulator is a Java implementation of the ns-2 simulator originally from Berkeley.n
💻 JAVA
字号:
package jns.command;


/**
 Command is a very important class in JNS because it represents the commands
 that the simulator is supposed to execute at a specific time.<br>
 You have to subclass command to make use of it. You can then use it to
 schedule a call to your class' foobar() function after x seconds.
 */
public abstract class Command
{

    String m_name;         // Name of the command (be artistic)
    double m_time;         // The time at which the command should be executed

    /**
     Create a new command class with a specific name to execute at some
     specific time.
     @param name name of the command
     @param time the time at which to execute the command
     */
    public Command(String name, double time)
    {
        m_name = name;
        m_time = time;
    }


    /**
     Return the command's execution time.
     */
    public double getTime()
    {
        return m_time;
    }

    /**
     Return the command's name.
     */
    public String getName()
    {
        return m_name;
    }

    /**
     Debugging output, print's the command's name.
     */
    public void dump()
    {
        System.out.println(m_name + ": " + m_time);
    }

    /**
     The execution function. Has to be overridden by subclasses.
     */
    public abstract void execute();

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -