EMMA Coverage Report (generated Sat Jun 02 16:47:50 EDT 2012)
[all classes][net.sf.madmap]

COVERAGE SUMMARY FOR SOURCE FILE [RootComparator.java]

nameclass, %method, %block, %line, %
RootComparator.java100% (1/1)100% (2/2)100% (47/47)100% (12/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RootComparator100% (1/1)100% (2/2)100% (47/47)100% (12/12)
RootComparator (String): void 100% (1/1)100% (6/6)100% (3/3)
compare (Object, Object): int 100% (1/1)100% (41/41)100% (9/9)

1/*
2 * Copyright 2008 Eric Caspole
3 * 
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
5 * file except in compliance with the License. You may obtain a copy of the License at
6 * 
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * 
9 * Unless required by applicable law or agreed to in writing, software distributed under
10 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11 * KIND, either express or implied. See the License for the specific language governing
12 * permissions and limitations under the License.
13 */
14 
15package net.sf.madmap;
16 
17import java.util.Comparator;
18 
19public class RootComparator implements Comparator {
20 
21  String  _root_sort;
22 
23  public RootComparator( String sortKind ) {
24    _root_sort = sortKind;
25  }
26 
27  public int compare( Object aa, Object bb ) {
28    
29    HprofRoot a = (HprofRoot) aa;
30    HprofRoot b = (HprofRoot) bb;
31 
32    String ra = a.rootType();
33    String rb = b.rootType();
34 
35    if (ra.equals(_root_sort) && (!rb.equals(_root_sort))) {
36      return -1;
37    } else if (( ra == rb ) || (!ra.equals(_root_sort) && (!rb.equals(_root_sort)))){
38      return 0; 
39    } else {
40      return 1;
41    }
42  }
43}

[all classes][net.sf.madmap]
EMMA 2.0.5312 (C) Vladimir Roubtsov