Ekahau::Response::AreaList - Represents a list of areas contained in an Ekahau response


Ekahau documentation Contained in the Ekahau distribution.

Index


Code Index:

NAME

Top

Ekahau::Response::AreaList - Represents a list of areas contained in an Ekahau response

SYNOPSIS

Top

Contains information about a list of areas, possibly from an Ekahau::Response::AreaEstimate object.

DESCRIPTION

Top

Constructor

Generally you will not want to construct these objects yourself; they are created by Ekahau::Response, and use its constructor.

Methods

get ( $which )

Return Ekahau::Response::Area object number $which.

get_all ( )

Return all Ekahau::Response::Area objects in this list.

num_areas

Returns the number of areas in this object

type ( )

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.

AUTHOR

Top

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.

SEE ALSO

Top

Ekahau::Response, Ekahau::Response::Area, Ekahau::Response::AreaEstimate.


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;