public static Class [ ] getAllUniqueInterfaces ( Class c ) { Set uniqueIfaces = new HashSet ( ) ; while ( c != null ) { Class [ ] ifaces = c . getInterfaces ( ) ; for ( int n = 0 ; n < ifaces . length ; n ++ ) { uniqueIfaces . add ( ifaces [ n ] ) ; } c = c . getSuperclass ( ) ; } return ( Class [ ] ) uniqueIfaces . toArray ( new Class [ uniqueIfaces . size ( ) ] ) ; }
Returns an array containing all the unique interfaces implemented by the argument class c and all its superclasses . Interfaces that appear multiple times through inheritence are only accounted for once .