File: IItem.java

package info (click to toggle)
emma-coverage 2.0.5312%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 2,000 kB
  • ctags: 3,667
  • sloc: java: 23,109; xml: 414; makefile: 22
file content (75 lines) | stat: -rw-r--r-- 2,825 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
 * 
 * This program and the accompanying materials are made available under
 * the terms of the Common Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/cpl-v10.html
 * 
 * $Id: IItem.java,v 1.1.1.1.2.1 2005/06/12 22:43:11 vlad_r Exp $
 */
package com.vladium.emma.report;

import java.util.Iterator;

// ----------------------------------------------------------------------------
/**
 * @author Vlad Roubtsov, (C) 2003
 */
public
interface IItem
{
    // public: ................................................................
    
    // TODO: consider making this an abstact class [merge into Item]
    
    // note: this design does not enforce all items at the same level being of the same 'type' (class, pkg, method, etc)    

    IItem getParent ();
    int getChildCount ();
    Iterator /* IItem */ getChildren ();
    /**
     * 
     * @param order [null is equivalent to no sort]
     * @return
     */
    Iterator /* IItem */ getChildren (ItemComparator /* IItem */ order);
    
    String getName ();   
    IItemMetadata getMetadata ();
    IItemAttribute getAttribute (int attributeID, int unitsID);
    int getAggregate (int type);
    
    void accept (IItemVisitor visitor, Object ctx);


    // TODO: move these elsewhere and fix gaps
        // WARNING: careful about reordering!
    
        // (coverage data) measured in counts:
        int COVERAGE_CLASS_COUNT    = 5; // count of class loads
        int COVERAGE_METHOD_COUNT   = 4; // count of method entries
        
        // (coverage data) measured in counts or instrs:
        int COVERAGE_BLOCK_COUNT    = 0; // in count units
        int COVERAGE_LINE_COUNT     = 1; // in count units
        int COVERAGE_BLOCK_INSTR    = 2; // in instr units
        int COVERAGE_LINE_INSTR     = 3; // total line instr coverage, scaled up by PRECISION
        
    
        // (metadata) measured in counts:
        int TOTAL_CLASS_COUNT       = 11;
        int TOTAL_METHOD_COUNT      = 10;
    
        // (metadata) measured in counts or instrs:
        int TOTAL_BLOCK_COUNT       = 6; // in count units
        int TOTAL_LINE_COUNT        = 7; // in count units
        int TOTAL_BLOCK_INSTR       = 8; // in instr units
        //int TOTAL_LINE_INSTR        = 9; // in instr units
       
        int TOTAL_SRCFILE_COUNT     = 12;
        //int TOTAL_SRCLINE_COUNT     = 13;
        
        int NUM_OF_AGGREGATES = TOTAL_SRCFILE_COUNT + 1;
        int PRECISION = 100; // BUG_SF988160: increase overflow safety margin for very large projects  
   
} // end of interface
// ----------------------------------------------------------------------------