1/* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
2 *
3 * This program and the accompanying materials are made available under
4 * the terms of the Common Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/cpl-v10.html
6 *
7 * $Id: IItem.java,v 1.1.1.1.2.1 2005/06/12 22:43:11 vlad_r Exp $
8 */
9package com.vladium.emma.report;
10
11import java.util.Iterator;
12
13// ----------------------------------------------------------------------------
14/**
15 * @author Vlad Roubtsov, (C) 2003
16 */
17public
18interface IItem
19{
20    // public: ................................................................
21
22    // TODO: consider making this an abstact class [merge into Item]
23
24    // note: this design does not enforce all items at the same level being of the same 'type' (class, pkg, method, etc)
25
26    IItem getParent ();
27    int getChildCount ();
28    Iterator /* IItem */ getChildren ();
29    /**
30     *
31     * @param order [null is equivalent to no sort]
32     * @return
33     */
34    Iterator /* IItem */ getChildren (ItemComparator /* IItem */ order);
35
36    String getName ();
37    IItemMetadata getMetadata ();
38    IItemAttribute getAttribute (int attributeID, int unitsID);
39    int getAggregate (int type);
40
41    void accept (IItemVisitor visitor, Object ctx);
42
43
44    // TODO: move these elsewhere and fix gaps
45        // WARNING: careful about reordering!
46
47        // (coverage data) measured in counts:
48        int COVERAGE_CLASS_COUNT    = 5; // count of class loads
49        int COVERAGE_METHOD_COUNT   = 4; // count of method entries
50
51        // (coverage data) measured in counts or instrs:
52        int COVERAGE_BLOCK_COUNT    = 0; // in count units
53        int COVERAGE_LINE_COUNT     = 1; // in count units
54        int COVERAGE_BLOCK_INSTR    = 2; // in instr units
55        int COVERAGE_LINE_INSTR     = 3; // total line instr coverage, scaled up by PRECISION
56
57
58        // (metadata) measured in counts:
59        int TOTAL_CLASS_COUNT       = 11;
60        int TOTAL_METHOD_COUNT      = 10;
61
62        // (metadata) measured in counts or instrs:
63        int TOTAL_BLOCK_COUNT       = 6; // in count units
64        int TOTAL_LINE_COUNT        = 7; // in count units
65        int TOTAL_BLOCK_INSTR       = 8; // in instr units
66        //int TOTAL_LINE_INSTR        = 9; // in instr units
67
68        int TOTAL_SRCFILE_COUNT     = 12;
69        //int TOTAL_SRCLINE_COUNT     = 13;
70
71        int NUM_OF_AGGREGATES = TOTAL_SRCFILE_COUNT + 1;
72        int PRECISION = 100; // BUG_SF988160: increase overflow safety margin for very large projects
73
74} // end of interface
75// ----------------------------------------------------------------------------