Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35360

Re: XML

Newsgroups comp.lang.java.programmer
Date 2016-08-16 13:20 -0700
References (11 earlier) <nofttr$u80$1@dont-email.me> <00fae8a8-dc01-435f-9f33-e5a5055d93df@googlegroups.com> <nonsuv$425$1@gioia.aioe.org> <9c174795-1c98-46f0-bbac-179581cd39a2@googlegroups.com> <novr71$8j0$1@dont-email.me>
Message-ID <6eae6f69-b51d-4e1a-9308-fb68fc735db8@googlegroups.com> (permalink)
Subject Re: XML
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Tuesday, August 16, 2016 at 3:57:32 PM UTC-4, Eric Sosman wrote:
>      No: The "streams" Arne mentions are not the "XMLStreams" and
> "StreamSources" found at your link.  See
> 
> http://docs.oracle.com/javase/tutorial/collections/streams/index.html
> 
>      (Note also that Arne's example is slightly abbreviated, or perhaps
> slightly optimistic: The findFirst() operation produces an Optional
> that will be empty if nothing satisfies the filter() predicate, and
> performing get() on an empty Optional throws NoSuchElementException.
> "Serious" code would have to be cognizant of the possibility.)

Yeah I got a test program working using the XMLStreams.  It looks like that could be optimal on my previously mentioned XML format only if I need to read and write a single DataRecord each time, creating a new DataFile instead of reconstructing the DataFile object that is the root of the file.

Arne's example appears to be reconstructing the entire DataFile, storing the DataRecords in List form, and searching the entire List for records.  I don't know how efficient that is with the stream().  It sounds like a lot of overhead.  I have another working option to store the DataRecords in a TreeMap and write that to the XML with an XMLAdapter so I can find an individual record with a key value and traverse the map to return a range of values.  I normally only get a specific value or all values from a map but it looks like the higherEntry() method will handle that.  The downside is I need multiple key maps set up linking all records if I need to return a range on different keys ie a list of Customers by Name, or by State, with the key field(s) hard coded while the stream() method appears more dynamic.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

XML Eric Douglas <e.d.programmer@gmail.com> - 2016-07-29 13:25 -0700
  Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-07-29 19:46 -0400
  Re: XML Roedy Green <inquiry@mindprod.com> - 2016-07-30 17:09 -0700
    Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-07-30 21:49 -0400
      Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-07-30 22:35 -0400
      Re: XML Roedy Green <inquiry@mindprod.com> - 2016-07-31 21:39 -0700
        Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-01 05:19 -0700
          Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-01 08:51 -0400
            Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-05 06:07 -0700
              Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-05 10:17 -0700
              Re: XML Stanimir Stamenkov <s7an10@netscape.net> - 2016-08-07 19:04 +0300
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-08 05:38 -0700
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-08 07:19 -0700
                Re: XML Stanimir Stamenkov <s7an10@netscape.net> - 2016-08-09 23:57 +0300
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-10 05:37 -0700
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-10 10:39 -0700
                Re: XML Stanimir Stamenkov <s7an10@netscape.net> - 2016-08-10 22:05 +0300
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-10 13:29 -0700
                Re: XML Stanimir Stamenkov <s7an10@netscape.net> - 2016-08-11 02:18 +0300
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-11 05:15 -0700
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-11 05:50 -0700
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-11 12:24 -0700
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-13 15:38 -0400
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-16 11:49 -0700
                Re: XML Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-16 15:57 -0400
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-16 13:20 -0700
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-16 17:04 -0400
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-16 21:37 -0400
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-17 05:22 -0700
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-17 05:21 -0700
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-16 16:13 -0400
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-16 13:22 -0700
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-16 16:53 -0400
                Re: XML Eric Douglas <e.d.programmer@gmail.com> - 2016-08-16 13:32 -0700
                Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-16 16:47 -0400
                Re: XML Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-16 16:59 -0400
        Re: XML Arne Vajhøj <arne@vajhoej.dk> - 2016-08-01 08:46 -0400

csiph-web