| Ekahau documentation | Contained in the Ekahau distribution. |
Ekahau::Response::AreaList - Represents a list of areas contained in an Ekahau response
Contains information about a list of areas, possibly from an Ekahau::Response::AreaEstimate object.
Generally you will not want to construct these objects yourself; they are created by Ekahau::Response, and use its constructor.
Return Ekahau::Response::Area object number $which.
Return all Ekahau::Response::Area objects in this list.
Returns the number of areas in this object
Returns the string AreaList, to identify the type of this object. Note that subclasses of this class will override this method, returning their own type string.
Scott Gifford <gifford@umich.edu>, <sgifford@suspectclass.com>
Copyright (C) 2005 The Regents of the University of Michigan.
See the file LICENSE included with the distribution for license information.
| Ekahau documentation | Contained in the Ekahau distribution. |
package Ekahau::Response::AreaList; use base 'Ekahau::Response'; our $VERSION=Ekahau::Response::VERSION; # Written by Scott Gifford <gifford@umich.edu> # Copyright (C) 2004 The Regents of the University of Michigan. # See the file LICENSE included with the distribution for license # information. use Ekahau::Response::Area; use constant AREA_CLASS => 'Ekahau::Response::Area'; use strict; use warnings;
# Internal method sub init { my $self = shift; warn "Created Ekahau::Response::AreaList object\n" if ($ENV{VERBOSE}); $self->{_areas}=[ map { $self->create_area($_) } @{$self->{params}{AREA}} ]; 1; } # Internal method sub create_area { my $self = shift; my($area)=@_; if (!$area) { return undef; } my $new = { %$self }; $new->{params} = { %$area }; bless $new,AREA_CLASS; $new->init; $new; }
sub get { my $self = shift; my($which)=@_; return $self->{_areas}[$which]; }
sub get_all { my $self = shift; return @{$self->{_areas}}; }
sub num_areas { my $self = shift; return scalar(@{$self->{_areas}}); }
sub type { 'AreaList'; }
1;