Lire::Report::Entry(3pm)

Lire::Report::Entry3pm

Interface to subreport's data.

Usage

    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";
        }
    }

Overview

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.

Version

$Id: Entry.pm,v 1.32 2006/07/23 13:16:31 vanbaal Exp $

Releases

6 releases since Debian 3.1 (Sarge); the text changed 5 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. Arch

Author

Francis J. Lacoste <[email protected]>

From lire 2.1.1-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.