commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [LANG] support for k, M suffices when parsing numbers
Date Thu, 02 Jun 2011 14:59:49 GMT
On Thu, Jun 2, 2011 at 10:54 AM, Stephen Colebourne <scolebourne@joda.org>wrote:

> I'd say creating a new class for one method is a bad idea. HumanUtils
> might work, although it could scope creep.
>
> Best approach is to try and think of other similar utilities, ie. look in
> Ant.
>

I was thinking that the class would also contain at least one toString
method, for example toString(1000, MemoryUnit.BYTES) where MemoryUnit is an
Enum. Useful for logging.

Gary


> Stephen
>
>
> On 2 June 2011 15:52, Gary Gregory <garydgregory@gmail.com> wrote:
> > On Thu, Jun 2, 2011 at 10:50 AM, James Carman <
> james@carmanconsulting.com>wrote:
> >
> >> On Thu, Jun 2, 2011 at 10:31 AM, Matt Benson <gudnabrsam@gmail.com>
> wrote:
> >> > FWIW, this type of code lives in Ant as long
> >> > org.apache.tools.ant.util.StringUtils#parseHumanSizes(String).  IMO it
> >> > would be fine to copy/adapt this method into lang3 in perhaps
> >> > StringUtils or NumberUtils.  No harm in creating MemUtils as James
> >> > suggested, but unless we can think of other things to go there I don't
> >> > know if it can be justified.
> >> >
> >>
> >> I would also suggest a method that takes a long and spits out a string
> >> with the biggest denomination (kb, mb, gb, etc.) it can find to
> >> display it.
> >>
> >> If it doesn't go in its own class, where else would you put it?
> >> Perhaps StringUtils or NumberUtils?  Maybe even SystemUtils, since
> >> there are memory-related methods in System?
> >>
> >
> > I like MemUtils so far.
> >
> > Gary
> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>
> >
> >
> > --
> > Thank you,
> > Gary
> >
> > http://garygregory.wordpress.com/
> > http://garygregory.com/
> > http://people.apache.org/~ggregory/
> > http://twitter.com/GaryGregory
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message