FileDocCategorySizeDatePackage
GsmCellLocation.javaAPI DocAndroid 1.5 API3015Wed May 06 22:42:00 BST 2009android.telephony.gsm

GsmCellLocation

public class GsmCellLocation extends android.telephony.CellLocation
Represents the cell location on a GSM phone.

Fields Summary
private int
mLac
private int
mCid
Constructors Summary
public GsmCellLocation()
Empty constructor. Initializes the LAC and CID to -1.

        mLac = -1;
        mCid = -1;
    
public GsmCellLocation(android.os.Bundle bundle)
Initialize the object from a bundle.

        mLac = bundle.getInt("lac");
        mCid = bundle.getInt("cid");
    
Methods Summary
public booleanequals(java.lang.Object o)

        GsmCellLocation s;
        
        try {
            s = (GsmCellLocation)o;
        } catch (ClassCastException ex) {
            return false;
        }

        if (o == null) {
            return false;
        }

        return equalsHandlesNulls(mLac, s.mLac) && equalsHandlesNulls(mCid, s.mCid);
    
private static booleanequalsHandlesNulls(java.lang.Object a, java.lang.Object b)
Test whether two objects hold the same data values or both are null

param
a first obj
param
b second obj
return
true if two objects equal or both are null

        return (a == null) ? (b == null) : a.equals (b);
    
public voidfillInNotifierBundle(android.os.Bundle m)
Set intent notifier Bundle based on service state

param
m intent notifier Bundle

        m.putInt("lac", mLac);
        m.putInt("cid", mCid);
    
public intgetCid()

return
gsm cell id, -1 if unknown, 0xffff max legal value

        return mCid;
    
public intgetLac()

return
gsm location area code, -1 if unknown, 0xffff max legal value

        return mLac;
    
public inthashCode()

        return mLac ^ mCid;
    
public voidsetLacAndCid(int lac, int cid)
Set the location area code and the cell id.

        mLac = lac;
        mCid = cid;
    
public voidsetStateInvalid()
Invalidate this object. The location area code and the cell id are set to -1.

        mLac = -1;
        mCid = -1;
    
public java.lang.StringtoString()

        return "["+ mLac + "," + mCid + "]";