?? task.java
字號:
package com.ict.netcom2.task;
import java.io.*;
public class Task implements Serializable {
private int taskId;
private long delay;
private boolean isRoutine;
private TaskParam param;
private int taskType;
private byte[] taskCode;
private String oid;
public Task (int taskId, long delay, boolean isRoutine,
TaskParam param) {
this.taskId = taskId;
this.delay = delay;
this.isRoutine = isRoutine;
this.param = param;
}
/**
*
* Must be called after {@link #taskType} initialized
*/
void encode() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
byte[] paramCode = param.getParamCode();
try {
dos.writeInt(taskId);
dos.writeInt((int)delay);
dos.writeBoolean(isRoutine);
dos.writeByte(taskType);
dos.writeInt(paramCode.length);
dos.write(paramCode);
dos.close();
baos.close();
} catch (IOException e) {
e.printStackTrace();
}
taskCode = baos.toByteArray();
}
public byte[] getTaskCode() {
return taskCode;
}
public String getOid() {
return oid;
}
public int getId() {
return taskId;
}
public int getType() {
return taskType;
}
void setType(int type) {
taskType = type;
}
void setOid(String oid) {
this.oid = oid;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -