public class Region extends Object implements Parcelable, Serializable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<Region> |
CREATOR
Required to make class Parcelable
|
protected double |
distance |
protected String |
mBluetoothAddress |
protected List<Identifier> |
mIdentifiers |
protected String |
mUniqueId |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Modifier | Constructor and Description |
|---|---|
protected |
Region(Parcel in) |
|
Region(String uniqueId,
Identifier id1,
Identifier id2,
Identifier id3)
Constructs a new Region object to be used for Ranging or Monitoring
|
|
Region(String uniqueId,
List<Identifier> identifiers)
Constructs a new Region object to be used for Ranging or Monitoring
|
|
Region(String uniqueId,
List<Identifier> identifiers,
String bluetoothAddress,
double distance)
Constructs a new Region object to be used for Ranging or Monitoring
|
|
Region(String uniqueId,
String bluetoothAddress)
Constructs a new Region object to be used for Ranging or Monitoring
|
| Modifier and Type | Method and Description |
|---|---|
Region |
clone()
Deprecated.
instances of this class are immutable and therefore don't have to be cloned when
used in concurrent code.
|
Region |
clone(Beacon beacon) |
int |
describeContents() |
boolean |
equals(Object other) |
String |
getBluetoothAddress()
Returns the mac address used to filter for beacons
|
double |
getDistance()
Returns the distance when enter region
|
Identifier |
getId1()
Convenience method to get the first identifier
|
Identifier |
getId2()
Convenience method to get the second identifier
|
Identifier |
getId3()
Convenience method to get the third identifier
|
Identifier |
getIdentifier(int i)
Returns the 0-indexed identifier
Note: IMPORTANT: to get id1, you would call getIdentifier(0);
|
String |
getUniqueId()
Returns the identifier used to start or stop ranging/monitoring this region when calling
the
BeaconManager methods. |
int |
hashCode() |
boolean |
hasSameIdentifiers(Region region) |
boolean |
matchesBeacon(Beacon beacon)
Checks to see if an Beacon object is included in the matching criteria of this Region
|
String |
toString() |
void |
writeToParcel(Parcel out,
int flags) |
public static final Parcelable.Creator<Region> CREATOR
protected final List<Identifier> mIdentifiers
protected final String mBluetoothAddress
protected final String mUniqueId
protected double distance
public Region(String uniqueId, Identifier id1, Identifier id2, Identifier id3)
uniqueId - - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredid1 - - most significant identifier (can be null)id2 - - second most significant identifier (can be null)id3 - - third most significant identifier (can be null)public Region(String uniqueId, List<Identifier> identifiers)
uniqueId - - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredidentifiers - - list of identifiers for this regionpublic Region(String uniqueId, List<Identifier> identifiers, String bluetoothAddress, double distance)
uniqueId - - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/Monitoredidentifiers - - list of identifiers for this regionbluetoothAddress - - mac addressdistance - - special distance when enter regionpublic Region(String uniqueId, String bluetoothAddress)
uniqueId - - A unique identifier used to later cancel Ranging and Monitoring, or change the region being Ranged/MonitoredbluetoothAddress - - mac address used to match beaconsprotected Region(Parcel in)
public Identifier getId1()
public Identifier getId2()
public Identifier getId3()
public Identifier getIdentifier(int i)
i - public String getUniqueId()
BeaconManager methods.public String getBluetoothAddress()
public double getDistance()
public boolean matchesBeacon(Beacon beacon)
beacon - the beacon to check to see if it is in the Regionpublic boolean hasSameIdentifiers(Region region)
public int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel out, int flags)
writeToParcel in interface Parcelable@Deprecated public Region clone()