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


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

Re: DefaultTableModel.getDataVector() and Java 11

Newsgroups comp.lang.java.programmer
Date 2019-04-03 10:34 -0700
References <slrnqa9lo4.cfl.avl@logic.at>
Message-ID <778656f9-94e9-4dbe-be40-1f65c70008d8@googlegroups.com> (permalink)
Subject Re: DefaultTableModel.getDataVector() and Java 11
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Wednesday, April 3, 2019 at 11:53:51 AM UTC-4, Andreas Leitgeb wrote:
> In Java up to 8  DefaultTableModel had a method  getDataVector()
> that returned a raw Vector.
> 
> My application's custom TableModel overrode the method to return
> a Vector<MyRowType>, where MyRowType provided direct type-safe
> accessors for each column.
> 
> In Java 11 it seems to have changed to returning a Vector of 
> raw Vectors.
> 
> At first glance this seems just goofy to me, because that doesn't
> really make it type-safe (it still involves a raw type), and it even
> prevents me from making it type-safe myself.
> 
> I hope, someone here can provide me with a second glance that
> clarifies the rationale behind the change.

It would seem I never found DefaultTableModel all that useful.  I have a class which contains the values needed to display one cell which just implements Comparable and Serializable.  Then I have a table model class which extends AbstractTableModel with an ArrayList variable.  Each element of the ArrayList contains a custom class which represents one row, constructed from a hard array [] of custom cell objects, implementing Comparable.  The custom table model class has a getRow method which returns a row class instance.  The custom row class has a getRowData method returning the entire array of cell data as well as a getColumnData method to return a single cell.

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


Thread

DefaultTableModel.getDataVector() and Java 11 Andreas Leitgeb <avl@logic.at> - 2019-04-03 15:53 +0000
  Re: DefaultTableModel.getDataVector() and Java 11 Patrick Roemer <sangamon@netcologne.de> - 2019-04-03 18:37 +0200
    Re: DefaultTableModel.getDataVector() and Java 11 Andreas Leitgeb <avl@logic.at> - 2019-04-03 16:41 +0000
  Re: DefaultTableModel.getDataVector() and Java 11 Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-04-03 12:44 -0400
    Re: DefaultTableModel.getDataVector() and Java 11 Andreas Leitgeb <avl@logic.at> - 2019-04-03 17:33 +0000
      Re: DefaultTableModel.getDataVector() and Java 11 Eric Douglas <e.d.programmer@gmail.com> - 2019-04-03 11:22 -0700
  Re: DefaultTableModel.getDataVector() and Java 11 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-04-03 18:49 +0200
  Re: DefaultTableModel.getDataVector() and Java 11 Eric Douglas <e.d.programmer@gmail.com> - 2019-04-03 10:34 -0700

csiph-web