You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Johannes Koch <jo...@fit.fraunhofer.de> on 2010/01/20 10:34:19 UTC

Too many detours in COSDictionary convenience methods

Hi,

I think there are too many detours in some of the COSDictionary 
convenience methods. E.g.

getInt( COSName key )
-> getInt( COSName key, int defaultValue )
    // create String from COSName
-> getInt( String key, int defaultValue )
-> getInt( String[] keyList, int defaultValue )
-> getDictionaryObject( String[] keyList )
    // create COSName from String
-> getDictionaryObject( COSName key )


Wouldn't it be easier to just do the following?

getInt( COSName key )
-> getDictionaryObject( COSName key )


Same with getLong(COSName):

getLong( COSName key )
-> getLong( COSName key, long defaultValue )
-> getLong( String key, long defaultValue )
-> getLong( String[] keyList, long defaultValue )
-> getDictionaryObject( String[] keyList )
-> getDictionaryObject( COSName key )

This could be reduced to:

getLong( COSName key )
-> getDictionaryObject( COSName key )


getFloat(COSName) has only one detour:

getFloat( COSName key )
-> getFloat( COSName key, float defaultValue )
-> getDictionaryObject( COSName key )

This could be reduced to:

getFloat( COSName key )
-> getDictionaryObject( COSName key )

-- 
Johannes Koch
Fraunhofer Institute for Applied Information Technology FIT
Web Compliance Center
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142628    Fax: +49-2241-142065

Re: Too many detours in COSDictionary convenience methods

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Mon, Feb 22, 2010 at 1:47 PM, Johannes Koch
<jo...@fit.fraunhofer.de> wrote:
> Johannes Koch schrieb:
>> I think there are too many detours in some of the COSDictionary
>> convenience methods.
>
> No comments? Should I create a JIRA issue?

Sounds good to me, go ahead!

BR,

Jukka Zitting

Re: Too many detours in COSDictionary convenience methods

Posted by Johannes Koch <jo...@fit.fraunhofer.de>.
Johannes Koch schrieb:

> I think there are too many detours in some of the COSDictionary 
> convenience methods.

[...]

No comments? Should I create a JIRA issue?

-- 
Johannes Koch
Fraunhofer Institute for Applied Information Technology FIT
Web Compliance Center
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142628    Fax: +49-2241-142065