Package onep :: Package location :: Module location :: Class LocationChangeFilter
[frames] | no frames]

Class LocationChangeFilter



The LocationChangeFilter is passed to Location.add_change_listener()
when configuring for notification of location change events.
Multiple filter attributes may be specified in a filter.
Once the filter has been used to configure a listener, it is no longer
needed and can be disposed. It can also be reused in order to setup 
filtering for another listener.
<p>
Location change filter information:
<ul>
<li>What types of location data should be watched for changes
</ul>
(More filtering types may be added in the future.)
<p><b>Example:</b></p>
    locA = ne.get_location()
    // Creating a filter for change events
    filter = LocationChangeFilter()
    filter.add_subtype(LocationSubtype.LOCATION_TYPE_GEO)
    // Add a listener for location change events
    listener = MyLocationChangeListener()        
    eh = locA.add_change_listener(listener, filter, null);

<pre>

Instance Methods
 
__init__(self)
Constructs a LocationChangeFilter object.
 
add_subtype(self, subtype)
This method adds a subtype which the filter will allow.
 
remove_subtype(self, subtype)
This method removes an allowed subtype from the filter.
 
has_subtype(self, subtype)
This function is used to query whether or not the filter is looking for a specific type of location data.
 
__len__(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

Constructs a LocationChangeFilter object.

The LocationChangeFilter is used in order to filter what types of LocationChangeEvent should be sent. Currently, the only type of filtering provided is via location subtype. If no filtering is specified, then changes to all types of location information contained in the Location will result in a notification.

Overrides: object.__init__

add_subtype(self, subtype)

 

This method adds a subtype which the filter will allow. Multiple subtypes may be added to the filter by calling this method multiple times. If the input subtype is null or if the subtype is already added in the filter, no futher action will be take by this method.

Parameters:
  • subtype - The subtype to be added to the filter.

remove_subtype(self, subtype)

 

This method removes an allowed subtype from the filter. If the input subtype is null or if the sybtype is not found in the filter, no futher action will be take by this method.

Parameters:
  • subtype - The subtype to be removed from the filter.

has_subtype(self, subtype)

 

This function is used to query whether or not the filter is looking for a specific type of location data.

Parameters:
  • subtype - Type of location information being requested
Returns:
True if the subtype requested exists; False otherwise.