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


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

Re: How to parse an array?

Newsgroups comp.lang.java.programmer
Date 2017-06-28 05:10 -0700
References (4 earlier) <967dfbc4-0e58-4867-b08c-67ff910df3fe@googlegroups.com> <642c0caf-de21-4add-8f61-8b68e94b1081@googlegroups.com> <oiudpv$imf$1@dont-email.me> <dc58b7e1-186b-472f-a088-f9b848481404@googlegroups.com> <oiumi8$6om$1@dont-email.me>
Message-ID <47fa7e7a-7757-46b0-a6bb-5084529a50e2@googlegroups.com> (permalink)
Subject Re: How to parse an array?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Tuesday, June 27, 2017 at 6:38:53 PM UTC-4, Martin Gregorie wrote:
> On Tue, 27 Jun 2017 14:01:20 -0700, Eric Douglas wrote:
> 
> > Yes my table model extends AbstractTableModel.  I have each cell value
> > in a custom object that handles getting and setting values by String or
> > numeric for different cell styles.  The model data is in an ArrayList. 
> > Each element of the ArrayList is an array [] of that cell class.
> >
> Sounds good, though as the row is a fixed size I'm curious why it isn't a 
> class instead, since that, given a getter/setter for each data element 
> would seem to be functionally very similar.
>  

So the long part is the DefaultRowSorter, trying to build an array of cells from scratch every time you change the sort order of columns or the filter clause.  So maybe I just need another level.  My table cell class is Comparable.  Now if I put them in a table row class that is Comparable then it can ask what order the columns go in and just sort themselves.

Now, the searchable table holds an ArrayList, indices are view row numbers, values are model row numbers.  This is where my question came in.  Even if the rows can sort themselves, isn't it more efficient to make a set of rows that match the filter (view) before I sort them, and how best to grab those row elements from the table model array.

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


Thread

How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-20 12:18 -0700
  Re: How to parse an array? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2017-06-20 14:49 -0500
  Re: How to parse an array? Arne Vajhøj <arne@vajhoej.dk> - 2017-06-20 16:15 -0400
  Re: How to parse an array? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-20 16:23 -0400
  Re: How to parse an array? Robert Klemme <shortcutter@googlemail.com> - 2017-06-24 12:02 +0200
    Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-26 05:10 -0700
      Re: How to parse an array? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-26 09:36 -0400
        Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-26 07:47 -0700
          Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-26 15:47 +0000
        Re: How to parse an array? Arne Vajhøj <arne@vajhoej.dk> - 2017-06-26 20:37 -0400
      Re: How to parse an array? lewbloch@gmail.com - 2017-06-27 12:29 -0700
        Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-27 12:50 -0700
          Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-27 20:05 +0000
            Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-27 14:01 -0700
              Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-27 22:34 +0000
                Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-28 05:10 -0700
                Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-28 19:09 +0000
                Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-28 13:02 -0700
                Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-28 21:55 +0000
                Re: How to parse an array? Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 06:10 -0700
                Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-30 16:52 +0000
  Re: How to parse an array? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-24 16:34 -0400
    Re: How to parse an array? Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-24 22:42 +0000
      Re: How to parse an array? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-24 20:05 -0400
      Re: How to parse an array? Robert Klemme <shortcutter@googlemail.com> - 2017-06-25 12:20 +0200

csiph-web