Re: [lang][collections] SortedProperties

2017-07-25 Thread Gary Gregory
I committed a simple SortedProperties class to [collections]. It's goal as Javadoc'd is only to sort keys. Tracking with: [COLLECTIONS-654] Add class SortedProperties to sort keys. Gary On Tue, Jul 18, 2017 at 3:50 PM, Jonathan Bluett-Duncan < jbluettdun...@gmail.com> wrote: > > > > Yes, of cou

Re: [lang][collections] SortedProperties

2017-07-18 Thread Jonathan Bluett-Duncan
> > Yes, of course, that's one way to go and also create a bunch of methods to > delegate to the wrapped Properties... BUT I cannot pass this object to a > method typed with "Properties". > Oh, that's a fair point. You've convinced me. :) On 18 July 2017 at 23:44, Gary Gregory wrote: > On Tue,

Re: [lang][collections] SortedProperties

2017-07-18 Thread Gary Gregory
On Tue, Jul 18, 2017 at 11:27 AM, Jonathan Bluett-Duncan < jbluettdun...@gmail.com> wrote: > I would strongly discourage subclassing `Properties` and instead I'd > encourage composing it into the proposed `SortedProperties` class, as > subclassing classes which weren't designed for inheritance is

Re: [lang][collections] SortedProperties

2017-07-18 Thread Gary Gregory
On Tue, Jul 18, 2017 at 1:16 PM, Oliver Heger wrote: > > > Am 18.07.2017 um 20:39 schrieb Gary Gregory: > > On Tue, Jul 18, 2017 at 11:25 AM, Rob Tompkins > wrote: > > > >> > >> > >>> On Jul 18, 2017, at 4:43 AM, Jörg Schaible >> com> wrote: > >>> > >>> Hi Gary, > >>> > >>> Gary Gregory wrote:

Re: [lang][collections] SortedProperties

2017-07-18 Thread Oliver Heger
Am 18.07.2017 um 20:39 schrieb Gary Gregory: > On Tue, Jul 18, 2017 at 11:25 AM, Rob Tompkins wrote: > >> >> >>> On Jul 18, 2017, at 4:43 AM, Jörg Schaible > com> wrote: >>> >>> Hi Gary, >>> >>> Gary Gregory wrote: >>> Hi, I'd to have a new class called SortedProperties that exte

Re: [lang][collections] SortedProperties

2017-07-18 Thread Simon Spero
On Jul 18, 2017 2:25 PM, "Rob Tompkins" wrote: I'm stuck in the in-between here with the following thought: HashTable certainly feels like a collection of objects, but it clearly extends Dictionary and isn't in the collections family. But we are in java.util here and not in java.lang, so that fee

Re: [lang][collections] SortedProperties

2017-07-18 Thread Gary Gregory
On Tue, Jul 18, 2017 at 11:25 AM, Rob Tompkins wrote: > > > > On Jul 18, 2017, at 4:43 AM, Jörg Schaible com> wrote: > > > > Hi Gary, > > > > Gary Gregory wrote: > > > >> Hi, > >> > >> I'd to have a new class called SortedProperties that extends > >> java.util.Properties. > >> > >> Should that g

Re: [lang][collections] SortedProperties

2017-07-18 Thread Jonathan Bluett-Duncan
I would strongly discourage subclassing `Properties` and instead I'd encourage composing it into the proposed `SortedProperties` class, as subclassing classes which weren't designed for inheritance is risky according to Effective Java 2nd Edition, Items 16 and 17. So for example: ``` public final

Re: [lang][collections] SortedProperties

2017-07-18 Thread Rob Tompkins
> On Jul 18, 2017, at 4:43 AM, Jörg Schaible > wrote: > > Hi Gary, > > Gary Gregory wrote: > >> Hi, >> >> I'd to have a new class called SortedProperties that extends >> java.util.Properties. >> >> Should that go in [lang] or [collections]? >> >> I first thought [lang], but it _is_ a coll

Re: [lang][collections] SortedProperties

2017-07-18 Thread Gary Gregory
Nope. All that I want is to write a Properties object with sorted lines. Simple as that. I do not even need to read a properties file into a SortedProperties but we can do that as well of course. This works: https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/util/SortedProper

Re: [lang][collections] SortedProperties

2017-07-18 Thread Simon Spero
On Jul 18, 2017 11:39 AM, "Gary Gregory" wrote: My use case is to write a Properties object in sorted key order, nothing fancy. The simplest way is to subclass Properties and override keys(). Loading a SortedProperties with a Map is not on my to-do list. Would your use case be served by one

Re: [lang][collections] SortedProperties

2017-07-18 Thread Gary Gregory
My use case is to write a Properties object in sorted key order, nothing fancy. The simplest way is to subclass Properties and override keys(). Loading a SortedProperties with a Map is not on my to-do list. Gary On Jul 18, 2017 00:41, "Javen O'Neal" wrote: > +1 for Lang. > > There aren't any p

Re: [lang][collections] SortedProperties

2017-07-18 Thread Matt Sicker
Yeah, I was confused. Persistent collections have a meaning (e.g., see < https://pcollections.org/> for a Java library implementation) a bit different from persistent entities. On 18 July 2017 at 05:18, Jonathan Bluett-Duncan wrote: > Javen, > > Just for clarity, by persistent collections, are y

Re: [lang][collections] SortedProperties

2017-07-18 Thread Jonathan Bluett-Duncan
Javen, Just for clarity, by persistent collections, are you talking about _functional_ persistent collections (a la Scala, Clojure and Haskell), _disk_-persisted collections, or some other definition of "persistent"? Jonathan On 18 Jul 2017 08:41, "Javen O'Neal" wrote: +1 for Lang. There aren

Re: [lang][collections] SortedProperties

2017-07-18 Thread Jörg Schaible
Hi Gary, Gary Gregory wrote: > Hi, > > I'd to have a new class called SortedProperties that extends > java.util.Properties. > > Should that go in [lang] or [collections]? > > I first thought [lang], but it _is_ a collection after all. > > Gary for me it's [collections]. [collections] is like

Re: [lang][collections] SortedProperties

2017-07-18 Thread Javen O'Neal
+1 for Lang. There aren't any persistent data structures in Collections, nor would I think to look in Collections to find one. Properties is a persistent hashtable. SortedProperties is a persistent TreeMap. Unless you're thinking about a new family of SortedProperties. Were you thinking about le

Re: [lang][collections] SortedProperties

2017-07-18 Thread Amey Jadiye
My opinion is this should go to *lang* because the fact is it's extended utility and not exactly as data structures though it looks like one. It's main purpose is to hold properties and not the data. Commons collection aims to provide utlilities and extension to data structures and not to properti

[lang][collections] SortedProperties

2017-07-17 Thread Gary Gregory
Hi, I'd to have a new class called SortedProperties that extends java.util.Properties. Should that go in [lang] or [collections]? I first thought [lang], but it _is_ a collection after all. Gary