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

📄 parsedata.java~3~

📁 用java写编写的一个GPS源代码请大家多多指教
💻 JAVA~3~
字号:
package com.gps.center.parsedata;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
import java.util.LinkedList;
import java.util.Hashtable;
import com.gps.center.parsedata.MsgObj;

//cMsgtype:1--TCPMSG,2--DEVICEUDPMSG,3--SMSMSG
//4--TCPSENDTODEVICE,5--UDPSENDTODEVICE,6--SMSSENDTODEVICE,7--TCPSENDTOTERMINAL,8--TCPRETURNTERMINAL

public class ParseData {
  public static Hashtable centerMap = new Hashtable();
  public static Hashtable classMap = new Hashtable();
  public static LinkedList recieveQueue = new LinkedList();
  public static LinkedList sendQueue = new LinkedList();
  public static String[][] DeviceIdType;
  public static String centerIp = null;
  public static String centerPort = null;
  public static boolean openservice = true;
  public static final int TCPMSG = 1;
  public static final int DEVICEUDPMSG = 2;
  public static final int SMSMSG = 3;
  public static final int TCPSENDTODEVICE = 4;
  public static final int UDPSENDTODEVICE = 5;
  public static final int SMSSENDTODEVICE = 6;
  public static final int TCPSENDTOTERMINAL = 7;
  public static final int TCPRETURNTERMINAL = 8;

  public ParseData() {
  }

  //synchronized
  public static void addSendMsg(MsgObj msg) {//添加发送队列
    sendQueue.addLast(msg);
  }

  public static MsgObj getSendMsg() {//得到发送队列
    MsgObj msg = (MsgObj) sendQueue.getFirst();
    sendQueue.removeFirst();
    return msg;
  }

  public static void removeSendMsg(MsgObj msg) {//从发送队列删除消息
    if (!sendQueue.isEmpty()) {
      sendQueue.remove(msg);
    }
  }

  public static void addRecieveMsg(MsgObj msg) {//添加消息到接收队列
    recieveQueue.addLast(msg);
  }

  public static MsgObj getRecieveMsg() {//从接收队列得到消息
    MsgObj msg = (MsgObj) recieveQueue.getFirst();
    recieveQueue.removeFirst();
    return msg;
  }

  public static void removeRecieveMsg(MsgObj msg) {//从接收队列删除消息
    if (!recieveQueue.isEmpty()) {
      recieveQueue.remove(msg);
    }
  }
}

⌨️ 快捷键说明

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