Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01DC04868 for ; Thu, 2 Jun 2011 15:00:16 +0000 (UTC) Received: (qmail 85759 invoked by uid 500); 2 Jun 2011 15:00:15 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 85686 invoked by uid 500); 2 Jun 2011 15:00:15 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 85678 invoked by uid 99); 2 Jun 2011 15:00:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 15:00:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garydgregory@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 15:00:09 +0000 Received: by fxm3 with SMTP id 3so828707fxm.30 for ; Thu, 02 Jun 2011 07:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=n2+2sxOKRtI57vAYZ7zWjscFt07Gh6XXxl5jMvcvcSw=; b=c8MGNa11ZQmZrth2nrKQex0I8khmKNt0IQflC6zxeb+wI2hfcsLxkVR8Dk+/VtVCBP 5wRAdJs0fXebtaMuZPv7VMX3EKvKvbyEk8LiJZGTEz1gOEagpnc+jFEh5Lx9rlii5qtT 72ST7pR8bOUWzHTKHekOVh/UfEuDRO0ggUgVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=k8JAzHA/XMA9MybM5zuqGJlAgDPj9kwfQJCPImlcsTy5HDsAcgnoIq05S1F0HZ9mRN /ZhnWom8BWyMbEp0JDHEiERkPtmjEEFARh1RaZFZ2r/TRM+bbusF2bFqceuYvcYdgbsG 5j6LAZe/MWWL9+SraZnSL7Q9H95KvVZbp9U/s= MIME-Version: 1.0 Received: by 10.223.59.92 with SMTP id k28mr937120fah.27.1307026789300; Thu, 02 Jun 2011 07:59:49 -0700 (PDT) Received: by 10.223.113.146 with HTTP; Thu, 2 Jun 2011 07:59:49 -0700 (PDT) In-Reply-To: References: <-3806504398009589968@unknownmsgid> Date: Thu, 2 Jun 2011 10:59:49 -0400 Message-ID: Subject: Re: [LANG] support for k, M suffices when parsing numbers From: Gary Gregory To: Commons Developers List Content-Type: multipart/alternative; boundary=00151744874e7cfa1c04a4bbe345 X-Virus-Checked: Checked by ClamAV on apache.org --00151744874e7cfa1c04a4bbe345 Content-Type: text/plain; charset=UTF-8 On Thu, Jun 2, 2011 at 10:54 AM, Stephen Colebourne 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 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 > 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 --00151744874e7cfa1c04a4bbe345--