[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    DO NOT REPLY [Bug 34254]  New:  -
From:       bugzilla () apache ! org
Date:       2005-03-31 20:27:49
Message-ID: 20050331202749.D191D28A () ajax ! apache ! org
[Download RAW message or body]

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34254>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34254

           Summary: [id] New string identifier generators,
                    PrefixedNumericGenerator &c.
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: heuermh@acm.org


In order to generate identifiers for an instance of the Ensembl database [1], I needed a generator for 
identifiers of the style ENSG000001, ENSG000002, ENST000001, ENST000002, ENSP000001, and so on.  

Attached is a class PrefixedLeftPaddedNumericGenerator (sorry about the long class name) that solves 
this use case and also PrefixedNumericGenerator and PrefixedAlphanumericGenerator for 
completeness' sake.

new PrefixedLeftPaddedNumericGenerator("foo", true, 5); returns

foo01
foo02
foo03
foo04
foo05
foo06
foo07
foo08
foo09
foo10
foo11

new PrefixedNumericGenerator("foo", true, 0L) returns

foo1
foo2
foo3
foo4
foo5
foo6
foo7
foo8
foo9
foo10
foo11

new PrefixedAlphanumericGenerator("foo", true, 5); returns

foo01
foo02
foo03
foo04
foo05
foo06
foo07
foo08
foo09
foo0a
foo0b

[1]
> http://www.ensembl.org

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic