public int parse(String s) throws CronException
    {
        if (names != null)
        {
            for (int i = 0; i < names.length; ++i)
            {
                if (names[i].equalsIgnoreCase(s))
                {
                    return minimum + i;
                }
            }
        }

        int value;

        try
        {
            value = Integer.decode(s);
        }
        catch (NumberFormatException e)
        {
            throw new CronException(String.format("Invalid cron field value \"%s\" for field type \"%s\"", s, this), e);
        }

        if (value < minimum)
        {
            throw new CronException(String.format(
                "Cron field value \"%d\" less than minimum \"%d\" for field type \"%s\"", value, minimum, this));
        }

        if (value > maximum)
        {
            throw new CronException(String.format(
                "Cron field value \"%d\" greater than maximum \"%d\" for field type \"%s\"", value, maximum, this));
        }

        if ((overflow) && (value == maximum))
        {
            value = minimum;
        }

        return value;
    }