?? copierstatusinfo.java
字號(hào):
/*
$Author: $
$Date: $
$Revision: $
$NoKeywords: $
*/
package jp.co.ntl.user;
public class CopierStatusInfo implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public final static int OPTION_PRINTER = 0;
public final static int OPTION_JAM = 1;
public final static int OPTION_DOOR = 2;
public final static int OPTION_USER = 3;
public final static int OPTION_ADMIN = 4;
public final static int OPTION_SERVICE = 5;
private String[] printerNos = null;
private boolean[] printerReports = null;
private boolean printerState = false;
private String[] jamNos = null;
private boolean[] jamReports = null;
private boolean jamState = false;
private String[] doorNos = null;
private boolean[] doorReports = null;
private boolean doorState = false;
private String[] userNos = null;
private boolean[] userReports = null;
private boolean userState = false;
private String[] adminNos = null;
private boolean[] adminReports = null;
private boolean adminState = false;
private String[] serviceNos = null;
private boolean[] serviceReports = null;
private boolean serviceState = false;
public CopierStatusInfo() {
}
public void setCopierStatus(String[] nos, boolean report, boolean state, int option) {
switch (option) {
case OPTION_PRINTER:
if (nos == null) {
printerNos = null;
printerReports = null;
printerState = false;
} else {
printerNos = nos;
printerReports = new boolean[printerNos.length];
for (int i = 0; i < printerReports.length; i++) {
printerReports[i] = report;
}
printerState = state;
}
break;
case OPTION_JAM:
if (nos == null) {
jamNos = null;
jamReports = null;
jamState = false;
} else {
jamNos = nos;
jamReports = new boolean[jamNos.length];
for (int i = 0; i < jamReports.length; i++) {
jamReports[i] = report;
}
jamState = state;
}
break;
case OPTION_DOOR:
if (nos == null) {
doorNos = null;
doorReports = null;
doorState = false;
} else {
doorNos = nos;
doorReports = new boolean[doorNos.length];
for (int i = 0; i < doorReports.length; i++) {
doorReports[i] = report;
}
doorState = state;
}
break;
case OPTION_USER:
if (nos == null) {
userNos = null;
userReports = null;
userState = false;
} else {
userNos = nos;
userReports = new boolean[userNos.length];
for (int i = 0; i < userReports.length; i++) {
userReports[i] = report;
}
userState = state;
}
break;
case OPTION_ADMIN:
if (nos == null) {
adminNos = null;
adminReports = null;
adminState = false;
} else {
adminNos = nos;
adminReports = new boolean[adminNos.length];
for (int i = 0; i < adminReports.length; i++) {
adminReports[i] = report;
}
adminState = state;
}
break;
case OPTION_SERVICE:
if (nos == null) {
serviceNos = null;
serviceReports = null;
serviceState = false;
} else {
serviceNos = nos;
serviceReports = new boolean[serviceNos.length];
for (int i = 0; i < serviceReports.length; i++) {
serviceReports[i] = report;
}
serviceState = state;
}
break;
}
}
public String[] getNos(int option) {
if (option == OPTION_PRINTER) {
return printerNos;
} else if (option == OPTION_JAM) {
return jamNos;
} else if (option == OPTION_DOOR) {
return doorNos;
} else if (option == OPTION_USER) {
return userNos;
} else if (option == OPTION_ADMIN) {
return adminNos;
} else if (option == OPTION_SERVICE) {
return serviceNos;
}
return null;
}
public boolean[] getReports(int option) {
if (option == OPTION_PRINTER) {
return printerReports;
} else if (option == OPTION_JAM) {
return jamReports;
} else if (option == OPTION_DOOR) {
return doorReports;
} else if (option == OPTION_USER) {
return userReports;
} else if (option == OPTION_ADMIN) {
return adminReports;
} else if (option == OPTION_SERVICE) {
return serviceReports;
} else {
return null;
}
}
public void setReports(boolean[] reports, int option) {
if (option == OPTION_PRINTER) {
printerReports = reports;
} else if (option == OPTION_JAM) {
jamReports = reports;
} else if (option == OPTION_DOOR) {
doorReports = reports;
} else if (option == OPTION_USER) {
userReports = reports;
} else if (option == OPTION_ADMIN) {
adminReports = reports;
} else if (option == OPTION_SERVICE) {
serviceReports = reports;
}
}
public void setReports(boolean report, int option) {
switch (option) {
case OPTION_PRINTER:
if (printerReports != null) {
for (int i = 0; i < printerReports.length; i++) {
printerReports[i] = report;
}
}
break;
case OPTION_JAM:
if (jamReports != null) {
for (int i = 0; i < jamReports.length; i++) {
jamReports[i] = report;
}
}
break;
case OPTION_DOOR:
if (doorReports != null) {
for (int i = 0; i < doorReports.length; i++) {
doorReports[i] = report;
}
}
break;
case OPTION_USER:
if (userReports != null) {
for (int i = 0; i < userReports.length; i++) {
userReports[i] = report;
}
}
break;
case OPTION_ADMIN:
if (adminReports != null) {
for (int i = 0; i < adminReports.length; i++) {
adminReports[i] = report;
}
}
break;
case OPTION_SERVICE:
if (serviceReports != null) {
for (int i = 0; i < serviceReports.length; i++) {
serviceReports[i] = report;
}
}
break;
}
}
public boolean isState(int option) {
if (option == OPTION_PRINTER) {
return printerState;
} else if (option == OPTION_JAM) {
return jamState;
} else if (option == OPTION_DOOR) {
return doorState;
} else if (option == OPTION_USER) {
return userState;
} else if (option == OPTION_ADMIN) {
return adminState;
} else if (option == OPTION_SERVICE) {
return serviceState;
} else {
return false;
}
}
public void setState(boolean state, int option) {
if (option == OPTION_PRINTER) {
printerState = state;
} else if (option == OPTION_JAM) {
jamState = state;
} else if (option == OPTION_DOOR) {
doorState = state;
} else if (option == OPTION_USER) {
userState = state;
} else if (option == OPTION_ADMIN) {
adminState = state;
} else if (option == OPTION_SERVICE) {
serviceState = state;
}
}
public void compareStatus(String nos) {
if (nos == null) {
return;
}
if (printerNos != null) {
for (int i = 0; i < printerNos.length; i++) {
if (nos.indexOf(printerNos[i]) != -1) {
printerReports[i] = true;
if ( !printerState) {
printerState = true;
}
}
}
}
if (jamNos != null) {
for (int i = 0; i < jamNos.length; i++) {
if (nos.indexOf(jamNos[i]) != -1) {
jamReports[i] = true;
if (!jamState) {
jamState = true;
}
}
}
}
if (doorNos != null) {
for (int i = 0; i < doorNos.length; i++) {
if (nos.indexOf(doorNos[i]) != -1) {
doorReports[i] = true;
if (!doorState) {
doorState = true;
}
}
}
}
if (userNos != null) {
for (int i = 0; i < userNos.length; i++) {
if (nos.indexOf(userNos[i]) != -1) {
userReports[i] = true;
if (!userState) {
userState = true;
}
}
}
}
if (adminNos != null) {
for (int i = 0; i < adminNos.length; i++) {
if (nos.indexOf(adminNos[i]) != -1) {
adminReports[i] = true;
if (!adminState) {
adminState = true;
}
}
}
}
if (serviceNos != null) {
for (int i = 0; i < serviceNos.length; i++) {
if (nos.indexOf(serviceNos[i]) != -1) {
serviceReports[i] = true;
if (!serviceState) {
serviceState = true;
}
}
}
}
}
public String getResultStatus() {
String results = "";
if (printerNos != null && printerReports != null) {
for (int i = 0; i < printerReports.length; i++) {
if (printerReports[i]) {
results += (printerNos[i] + " ");
}
}
}
if (jamNos != null && jamReports != null) {
for (int i = 0; i < jamReports.length; i++) {
if (jamReports[i]) {
results += (jamNos[i] + " ");
}
}
}
if (doorNos != null && doorReports != null) {
for (int i = 0; i < doorReports.length; i++) {
if (doorReports[i]) {
results += (doorNos[i] + " ");
}
}
}
if (userNos != null && userReports != null) {
for (int i = 0; i < userReports.length; i++) {
if (userReports[i]) {
results += (userNos[i] + " ");
}
}
}
if (adminNos != null && adminReports != null) {
for (int i = 0; i < adminReports.length; i++) {
if (adminReports[i]) {
results += (adminNos[i] + " ");
}
}
}
if (serviceNos != null && serviceReports != null) {
for (int i = 0; i < serviceReports.length; i++) {
if (serviceReports[i]) {
results += (serviceNos[i] + " ");
}
}
}
return results;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -