src/edu/kit/informatik/Utilities.java
/**
     * Calculates the h-index factor for a collection of citation counts.
     * The calculation method is described in detail in the first final assignment, command C16
     * @param values a collection of citation numbers
     * @return the h-index factor for the given collection
     */
Calculates the h-index factor for a collection of citation counts.
The calculation method is described in detail in the first final assignment, command C16
@param values a collection of citation numbers
@return the h-index factor for the given collection
Calculates the h - index factor for a collection of citation counts . The calculation method is described in detail in the first final assignment command C16 @param values a collection of citation numbers @return the h - index factor for the given collection
public static int directHIndex(final Collection<Integer> values) {
        int hIndex = 0;
        final List<Integer> sortedValues = values.stream()
            .sorted((v1, v2) -> Integer.compare(v2, v1))
            .collect(Collectors.toList());
        for (int i = 0; i < sortedValues.size(); i++) {
            if (sortedValues.get(i) < i + 1) {
                hIndex = i;
                break;
            }  
        }
        return hIndex;
    }
public static int directHIndex ( final Collection < Integer > values ) { int hIndex = 0 ; final List < Integer > sortedValues = values . stream ( ) . sorted ( ( v1 , v2 ) -> Integer . compare ( v2 , v1 ) ) . collect ( Collectors . toList ( ) ) ; for ( int i = 0 ; i < sortedValues . size ( ) ; i ++ ) { if ( sortedValues . get ( i ) < i + 1 ) { hIndex = i ; break ; } } return hIndex ; }
Calculates the h-index factor for a collection of citation counts.
Calculates the h - index factor for a collection of citation counts .