class COSNumber extends COSBase
{
    /**
     * This will get the float value of this number.
     *
     * @return The float value of this object.
     */
    public abstract float floatValue();

    /**
     * This will get the integer value of this number.
     *
     * @return The integer value of this number.
     */
    public abstract int intValue();

    /**
     * This will get the long value of this number.
     *
     * @return The long value of this number.
     */
    public abstract long longValue();

    /**
     * This factory method will get the appropriate number object.
     *
     * @param number The string representation of the number.
     *
     * @return A number object, either float or int.
     *
     * @throws IOException If the string is not a number.
     */
    public static COSNumber get( String number ) throws IOException
    {<FILL_FUNCTION_BODY>}

    private static boolean isFloat( String number )
    {
        int length = number.length();
        for (int i = 0; i < length; i++)
        {
            char digit = number.charAt(i);
            if (digit == '.' || digit == 'e')
            {
                return true;
            }
        }
        return false;
    }
}

        if (number.length() == 1)
        {
            char digit = number.charAt(0);
            if ('0' <= digit && digit <= '9') 
            {
                return COSInteger.get((long) digit - '0');
            } 
            if (digit == '-' || digit == '.')
            {
                // See https://issues.apache.org/jira/browse/PDFBOX-592
                return COSInteger.ZERO;
            } 
            throw new IOException("Not a number: " + number);
        } 
        if (isFloat(number))
        {
            return new COSFloat(number);
        }
        try
        {
            return COSInteger.get(Long.parseLong(number));
        }
        catch (NumberFormatException e)
        {
            // check if the given string could be a number at all
            String numberString = number.startsWith("+") || number.startsWith("-")
                    ? number.substring(1) : number;
            if (!numberString.matches("[0-9]*"))
            {
                throw new IOException("Not a number: " + number);
            }
            // return a limited COSInteger value which is marked as invalid
            return number.startsWith("-") ? COSInteger.OUT_OF_RANGE_MIN
                    : COSInteger.OUT_OF_RANGE_MAX;
        }
    
<methods>public void <init>() ,public abstract void accept(org.apache.pdfbox.cos.ICOSVisitor) throws java.io.IOException,public org.apache.pdfbox.cos.COSBase getCOSObject() ,public org.apache.pdfbox.cos.COSObjectKey getKey() ,public boolean isDirect() ,public void setDirect(boolean) ,public void setKey(org.apache.pdfbox.cos.COSObjectKey) <variables>private boolean direct,private org.apache.pdfbox.cos.COSObjectKey key