afreechart/src/main/java/org/afree/chart/axis/DateTickUnit.java
/**
     * Converts a unit type to the corresponding deprecated integer constant.
     *
     * @param unitType  the unit type (<code>null</code> not permitted).
     *
     * @return The int code.
     *
     * @since JFreeChart 1.0.13
     */
Converts a unit type to the corresponding deprecated integer constant.
@param unitType  the unit type (null not permitted).

@return The int code.


Converts a unit type to the corresponding deprecated integer constant . @param unitType the unit type ( null not permitted ) . @return The int code .
private static int unitTypeToInt(DateTickUnitType unitType) {
        if (unitType == null) {
            throw new IllegalArgumentException("Null 'unitType' argument.");
        }
        if (unitType.equals(DateTickUnitType.YEAR)) {
            return YEAR;
        }
        else if (unitType.equals(DateTickUnitType.MONTH)) {
            return MONTH;
        }
        else if (unitType.equals(DateTickUnitType.DAY)) {
            return DAY;
        }
        else if (unitType.equals(DateTickUnitType.HOUR)) {
            return HOUR;
        }
        else if (unitType.equals(DateTickUnitType.MINUTE)) {
            return MINUTE;
        }
        else if (unitType.equals(DateTickUnitType.SECOND)) {
            return SECOND;
        }
        else if (unitType.equals(DateTickUnitType.MILLISECOND)) {
            return MILLISECOND;
        }
        else {
            throw new IllegalArgumentException(
                    "The 'unitType' is not recognised");
        }
    }
private static int unitTypeToInt ( DateTickUnitType unitType ) { if ( unitType == null ) { throw new IllegalArgumentException ( "Null 'unitType' argument." ) ; } if ( unitType . equals ( DateTickUnitType . YEAR ) ) { return YEAR ; } else if ( unitType . equals ( DateTickUnitType . MONTH ) ) { return MONTH ; } else if ( unitType . equals ( DateTickUnitType . DAY ) ) { return DAY ; } else if ( unitType . equals ( DateTickUnitType . HOUR ) ) { return HOUR ; } else if ( unitType . equals ( DateTickUnitType . MINUTE ) ) { return MINUTE ; } else if ( unitType . equals ( DateTickUnitType . SECOND ) ) { return SECOND ; } else if ( unitType . equals ( DateTickUnitType . MILLISECOND ) ) { return MILLISECOND ; } else { throw new IllegalArgumentException ( "The 'unitType' is not recognised" ) ; } }
Converts a unit type to the corresponding deprecated integer constant.
Converts a unit type to the corresponding deprecated integer constant .