hashobj.java~3~
来自「用java写编写的一个GPS源代码请大家多多指教」· JAVA~3~ 代码 · 共 64 行
JAVA~3~
64 行
package com.gps.center.fatherpack;
import java.nio.channels.SocketChannel;
import java.nio.channels.SelectionKey;
import java.util.Date;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.HashMap;
//初始化类
//public class HashObj extends Object {
public class HashObj {
public HashObj() {
this.cPhonNum = "";
this.cDeviceAdd = null;
this.cDevicePort = 0;
/* this.cTerminalAddress = "";
this.cTerminalPort = 0;
this.cDeviceSocket = null;
this.cTerminalSocket = new SocketChannel[10];
this.cTerminalSocketobj = new Terminalsocketobj();*/
this.cDeviceKey = null;
this.cTerminalKey = null;
this.cUdpSocket = null;
this.cDeviceTcpUsed = false;
this.cDeviceUdpUsed = false;
this.cDeviceSmsUsed = false;
this.cTerminalTcpUsed = false;
}
public String cPhonNum;
// public String cDeviceIP;
public static HashMap terminalMap = new HashMap();
public InetAddress cDeviceAdd;//网络地址的引用
public int cDevicePort;//设备端口
/* public SocketChannel cDeviceSocket = null;
public SocketChannel cTerminalSocket = null;
public String cTerminalAddress;
public int cTerminalPort;
public Terminalsocketobj cTerminalSocketobj;*/
public SelectionKey cDeviceKey;
public SelectionKey cTerminalKey;
public DatagramSocket cUdpSocket;
public boolean cDeviceTcpUsed;
public boolean cDeviceUdpUsed;
public boolean cDeviceSmsUsed;
public boolean cTerminalTcpUsed;
public Date cDateTime;
// class Terminalsocketobj {
// public Terminalsocketobj() {
// this.cTerminalAddress = "";
// this.cTerminalPort = 0;
// for (int i = 0; i < this.cTerminalSocket.length; i++) {
// cTerminalSocket[i] = null;
// }
// }
// public SocketChannel[] cTerminalSocket = new SocketChannel[100];
// public String cTerminalAddress;
// public int cTerminalPort;
// }
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?