You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Eric Barnhill (JIRA)" <ji...@apache.org> on 2019/01/17 21:54:00 UTC

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

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

Eric Barnhill edited comment on NUMBERS-92 at 1/17/19 9:53 PM:
---------------------------------------------------------------

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 this functionality is given its own class rather than encapsulated within Fraction() and BigFraction(), as their looks to be sufficient complexity around this issue to warrant a class devoted to it.

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.


was (Author: ericbarnhill):
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)