TUM CCSM Commons

edu.tum.cs.commons.reflect
Class FormalParameterComparator

java.lang.Object
  extended by edu.tum.cs.commons.reflect.FormalParameterComparator
All Implemented Interfaces:
java.util.Comparator<FormalParameter>

public class FormalParameterComparator
extends java.lang.Object
implements java.util.Comparator<FormalParameter>

This comparator orders formal parameters by their position within the formal parameter list of the defining method. This comparator raises an exception if the the compared parameters do not belong to the same method.

Version:
$Rev: 26283 $
Author:
Florian Deissenboeck, $Author: juergens $
Rating:
GREEN Hash: 06C5FDF68F8F0EF99EE068876259CBC7

Constructor Summary
FormalParameterComparator()
           
 
Method Summary
 int compare(FormalParameter p1, FormalParameter p2)
          Compae formal parameters by their position within the formal parameter list of the defining method.
 
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
 

Constructor Detail

FormalParameterComparator

public FormalParameterComparator()
Method Detail

compare

public int compare(FormalParameter p1,
                   FormalParameter p2)
            throws java.lang.IllegalArgumentException
Compae formal parameters by their position within the formal parameter list of the defining method.

Specified by:
compare in interface java.util.Comparator<FormalParameter>
Throws:
java.lang.IllegalArgumentException - if parameters belong to different methods.

TUM CCSM Commons

TUM CCSM Commons - 2.7