📄 mappin.java
字号:
package org.sreid.j2me.gmapviewer;import org.sreid.j2me.util.Util;class MapPin { final int x, y; String text = ""; int rmsID = -1; boolean isPermanent = true; // false for search results MapPin(int x, int y) { this.x = x; this.y = y; } MapPin(byte[] data, int off, int len) { this.x = Util.bytesToInt(data, off+0); this.y = Util.bytesToInt(data, off+4); this.text = new String(data, off+8, len-8); } int toBytes(byte[] data, int off) { Util.intToBytes(x, data, off+0); Util.intToBytes(y, data, off+4); byte[] tmp = text.getBytes(); System.arraycopy(tmp, 0, data, off+8, tmp.length); return 8 + tmp.length; } public String toString() { return "MapPin[" + x + "x" + y + ": " + text + "]"; } public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof MapPin)) return false; MapPin mp = (MapPin)o; return mp.x == x && mp.y == y && mp.text.equals(text); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -