[jira] [Commented] (NUMBERS-92) Rename AbstractFormat to AbstractFractionFormat

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (NUMBERS-92) Rename AbstractFormat to AbstractFractionFormat

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NUMBERS-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16745545#comment-16745545 ]

Eric Barnhill commented on NUMBERS-92:
--------------------------------------

FractionFormat and BigFraction format classes are not called from within the Fraction and BigFraction classes. They do a few things. When passed a fraction, they return a string representation of that fraction in locale-specific proper and improper forms (what is locale specific about fractions, I haven't a clue. Maybe it handles interchange between commas and decimals?). They also contain the functionality for parse() . I think these two use cases are surely their main ones, and I can see why they were spun out of the objects, as they are complicated enough to be their own classes.

They do have some additional functionality I would not have thought of myself. For example, if a double is send to format, it will return a fraction of that double. I think that's a little strange but maybe there was a use case for it that came up in the old days.

> Rename AbstractFormat to AbstractFractionFormat
> -----------------------------------------------
>
>                 Key: NUMBERS-92
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-92
>             Project: Commons Numbers
>          Issue Type: Improvement
>            Reporter: Eric Barnhill
>            Assignee: Eric Barnhill
>            Priority: Minor
>
> FractionFormat and BigFractionFormat have an abstract class. It is named AbstractFormat which is too general. Better to call it AbstractFractionFormat I think.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)