es.ucm.look.locationProviderWifi.wifi
Class NodoWifi

java.lang.Object
  extended by es.ucm.look.locationProviderWifi.wifi.NodoWifi
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>

public class NodoWifi
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

Mantains information of an Access Point


Field Summary
static int MAX_DIF
          MAX signal level - MIN signal level
 
Constructor Summary
NodoWifi(java.lang.String bssid, int level, int id)
          Parameterized contructor.
 
Method Summary
static int averageLevel(java.util.ArrayList<java.lang.Integer> l)
          Calculates the average signal of a list of signal values
 int compareTo(java.lang.Object o)
          Compares two nodes by signal level
 java.lang.String getBssid()
          Returns MAC address of the access point
 int getId()
          Returns the id number of the access point
 java.lang.String getKey()
          Returns the id number of the access point as a string
 int getLevel()
          Returns signal level of the access point
 int getSignalSimilarity(int signal)
          Compares the current AP signal with another and returns the similarity level between them.
static int maxLevel(java.util.ArrayList<java.lang.Integer> l)
          Calculates the maximum signal of a list of signal values
 java.lang.String toString()
          Returns access point information as a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_DIF

public static final int MAX_DIF
MAX signal level - MIN signal level

See Also:
Constant Field Values
Constructor Detail

NodoWifi

public NodoWifi(java.lang.String bssid,
                int level,
                int id)
Parameterized contructor.

Parameters:
bssid - MAC address of the access point
level - Signal level
id - Id nunmber
Method Detail

averageLevel

public static int averageLevel(java.util.ArrayList<java.lang.Integer> l)
Calculates the average signal of a list of signal values

Parameters:
l - List of signal levels
Returns:
mean of the signal levels

compareTo

public int compareTo(java.lang.Object o)
Compares two nodes by signal level

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>
Parameters:
o - Node to compare with the current
Returns:
0 if equals, -1 if current node lower, 1 if current node higher

getBssid

public java.lang.String getBssid()
Returns MAC address of the access point

Returns:
MAC address

getId

public int getId()
Returns the id number of the access point

Returns:
id number

getKey

public java.lang.String getKey()
Returns the id number of the access point as a string

Returns:
id number as a string

getLevel

public int getLevel()
Returns signal level of the access point

Returns:
signal level

getSignalSimilarity

public int getSignalSimilarity(int signal)
Compares the current AP signal with another and returns the similarity level between them.

Parameters:
signal - Signal level of the other AP.
Returns:
Similarity between signals

maxLevel

public static int maxLevel(java.util.ArrayList<java.lang.Integer> l)
Calculates the maximum signal of a list of signal values

Parameters:
l - List of signal levels
Returns:
maximum value

toString

public java.lang.String toString()
Returns access point information as a string

Overrides:
toString in class java.lang.Object
Returns:
String representing AP information