@Override
    public int getElementCount(final String elementType) {
        if (elementType == null) {
            throw new IllegalArgumentException("elementType must not be null.");
        }
        Integer count = elementCounts.get(elementType);
        if (count == null) {
            throw new IllegalArgumentException(
                    "Type does not exist in this file.");
        } else {
            return count;
        }
    }
@ Override public int getElementCount ( final String elementType ) { if ( elementType == null ) { throw new IllegalArgumentException ( "elementType must not be null." ) ; } Integer count = elementCounts . get ( elementType ) ; if ( count == null ) { throw new IllegalArgumentException ( "Type does not exist in this file." ) ; } else { return count ; } }
Gets the number of elements for a given element type.
@param elementType Name of the element type.
@return Number of elements of the given type.
@throws NullPointerException if {@code elementType} is {@code null}.
@throws IllegalArgumentException if there is no such type in this
file.