NAME¶
Lire::Report::Entry - Interface to subreport's data.
SYNOPSIS¶
foreach my $name ( $entry->names() ) {
print "Name: ", $name->{'content'}, "\n";
}
foreach my $value ( $entry->values() ) {
if ( ref $value eq 'Lire::Report::Group' ) {
# Value is a group
foreach my $e ( $value->entries() ) {
print_entry( $e );
}
} else {
print "Value: ", $value->{'content'}, "\n";
}
}
DESCRIPTION¶
The Lire::Report::Entry objects are used to hold the subreport's data.
CONSTRUCTOR¶
One creates a new Entry object by using the create_entry method on a
Lire::Report::Subreport or Lire::Report::Group object. Use the
add_name(),
create_group() and
add_value() methods to
fill the entry.
OBJECT METHODS¶
row_idx()¶
Returns the row index in the table body where this entry's data should be
displayed. If undef, this entry shouldn't be displayed.
subreport()¶
Returns the Lire::Report::Subreport object in which this entry is contained.
group()¶
Returns the Lire::Report::Group object which contains this entry.
group_info()¶
Returns the Lire::Report::GroupInfo which contains the information related to
the group in which this entry is.
data()¶
Returns as an array the data contained in this entry. This is a list of hashes
or Lire::Report::Group object.
data_by_name( $name )¶
Returns the data item contained in this Entry that was generated by the operator
named $name. Returns undef if no such data item can be found.
names()¶
Returns the names of the entry. This is an array of hashes. The name's hash
contains the following keys:
- type
- Always set to 'name'.
- content
- That's the actual content of the name element. This
contains the name in a format suitable for display.
- value
- This contains the unformatted value of the name. For
example, when the name is a time string, this attribute will contains the
time in seconds since epoch.
- missing_cases
- This value contains the number of DLF records which had a
undefined value in one of the required fields to compute this
statistic.
- range
- For some names, the actual content express a range (time,
size, etc.). This attribute contains the length of the range.
- col_info
- The Lire::Report::ColumnInfo object describing this
name.
add_name( $content, [$value], [$range] )¶
Adds a new name to this entry. Consult the documentation of the
names()
method for a description of the meaning of the various parameters which have
the same meaning as the keys with the same name.
The names, values and groups should be added in the order specified by this
entry's GroupInfo. You'll get an exception otherwise.
values()¶
Returns the values of the entry. This is an array of hashes or objects. If the
value is an hash, it has the following keys:
- type
- Always set to 'value'.
- content
- That's the actual content of the value element. This
contains the value in a format suitable for display.
- value
- This contains the unformatted value. For example, when
bytes are displayed using "1M" or "1.1G", this will
contain the value in single bytes.
- missing_cases
- The number of DLF records which had an undefined value in
one of fields required by this operator.
- total
- This is used by values that represent an average. It
contains the total which makes up the average.
- n
- This is used by values that represent an average. It
contains the total which was used in the division to compute the
average.
- col_info
- The Lire::Report::ColumnInfo object describing this
value.
groups()¶
Returns in an array the Lire::Report::Group contained in this Entry.
create_group()¶
Creates a new group for this entry. This will also append it to this entry data.
If you create the group out of order compared to the names and values that
should go in that entry, you'll get an exception.
add_value( %value )¶
Adds a new value to this entry. The value hash should at least contains the
'content' key. It can also includes values for the 'n', 'total' and
'missing_cases' keys. Consult the documentation of the
values() method
for a description of the meaning of the various parameters: these have the
same meaning as the keys with the same names.
The names, values and groups should be added in the order specified by this
entry's GroupInfo. You'll get an exception otherwise.
SEE ALSO¶
Lire::ReportParser::ReportBuilder(3pm)
Lire::Report(3pm)
Lire::Report::Subreport(3pm)
Lire::Report::Section(3pm)
Lire::Report::Group(3pm)
VERSION¶
$Id: Entry.pm,v 1.32 2006/07/23 13:16:31 vanbaal Exp $
COPYRIGHT¶
Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
AUTHOR¶
Francis J. Lacoste <flacoste@logreport.org>