de.smartics.exceptions.report.sort
Class MixedCodeComparator

Package class diagram package MixedCodeComparator
java.lang.Object
  extended by de.smartics.exceptions.report.sort.MixedCodeComparator
All Implemented Interfaces:
Comparator< CodeUtils.CodeContainer>

public class MixedCodeComparator
     
     
extends Object
implements Comparator< CodeUtils.CodeContainer>

Compares exception code information instances. The instances are ordered by their codes. This implementation takes care if the code stored is a simple Code or a NumberCode.

Author:
Robert Reiner
Todo:
It may be somewhat tricky to ensure that the compareTo rules are enforced. Maybe we should remove this one?

Field Summary
static MixedCodeComparator INSTANCE
          Singleton instance for reuse.
 
Constructor Summary
MixedCodeComparator()
          Default constructor.
 
Method Summary
 int compare(CodeUtils.CodeContainer o1, CodeUtils.CodeContainer o2)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

INSTANCE

public static final MixedCodeComparator INSTANCE
Singleton instance for reuse.

Constructor Detail

MixedCodeComparator

public MixedCodeComparator()
Default constructor.

Consider to use the singleton.

Method Detail

compare

public int compare(CodeUtils.CodeContainer o1,
                   CodeUtils.CodeContainer o2)

Specified by:
compare in interface Comparator<CodeUtils.CodeContainer>
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2007-null Kronseder & Reiner GmbH - smartics. All Rights Reserved.