Back to project page satstat.
The source code is released under:
GNU General Public License
If you think the Android project satstat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.vonglasow.michael.satstat.data; /*from w w w. j a v a 2s . c o m*/ public class CellTowerCdma extends CellTower { public static String FAMILY = "cdma"; private int bsid; private int nid; private int sid; public CellTowerCdma(int sid, int nid, int bsid) { super(); this.setSid(sid); this.setNid(nid); this.setBsid(bsid); } public int getBsid() { return bsid; } public int getNid() { return nid; } public int getSid() { return sid; } /** * Returns the cell identity in text form. * <p> * For CDMA-like networks this string has the following form: * <p> * {@code cdma:sid-nid-bsid} * <p> * The first is a string which uniquely identifies the network family. * It is followed by a colon and a sequence of System ID, Network ID and * Base Station ID, separated by dashes and with no leading zeroes. */ @Override public String getText() { return getText(sid, nid, bsid); } /** * Converts a SID/NID/BSID tuple to an identity string, or {@code null} * if BSID is invalid. */ public static String getText(int sid, int nid, int bsid) { int iSid = ((sid == -1) || (sid == Integer.MAX_VALUE)) ? CellTower.UNKNOWN : sid; int iNid = ((nid == -1) || (nid == Integer.MAX_VALUE)) ? CellTower.UNKNOWN : nid; if ((bsid == -1) || (bsid == Integer.MAX_VALUE)) return null; else return String.format("%s:%d-%d-%d", FAMILY, iSid, iNid, bsid); } public void setBsid(int bsid) { if ((bsid != Integer.MAX_VALUE) && (bsid != -1)) this.bsid = bsid; else this.bsid = CellTower.UNKNOWN; } public void setNid(int nid) { if ((nid != Integer.MAX_VALUE) && (nid != -1)) this.nid = nid; else this.nid = CellTower.UNKNOWN; } public void setSid(int sid) { if ((sid != Integer.MAX_VALUE) && (sid != -1)) this.sid = sid; else this.sid = CellTower.UNKNOWN; } }