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


Groups > comp.lang.java.programmer > #23175 > unrolled thread

Inserting In a List

Started bysubhabangalore@gmail.com
First post2013-04-02 03:11 -0700
Last post2013-04-03 10:35 +0100
Articles 20 on this page of 161 — 18 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Inserting In a List subhabangalore@gmail.com - 2013-04-02 03:11 -0700
    Re: Inserting In a List Roedy Green <see_website@mindprod.com.invalid> - 2013-04-02 03:59 -0700
    Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-02 08:27 -0300
    Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-02 08:59 -0300
      Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-02 21:06 +0000
        Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 18:22 -0400
          Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-02 22:52 +0000
            Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 02:04 +0200
              Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:20 -0400
                Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 21:03 -0400
                  Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 21:26 -0400
                    Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 22:29 -0400
                      Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:16 -0400
                Re: Inserting In a List Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-04-02 20:26 -0500
                  Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 21:29 -0400
                    Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:07 +0200
              Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 05:45 -0300
                Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 15:26 +0200
                  Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 18:09 -0300
                    Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 00:54 +0200
                      Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 20:30 -0300
                        Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:35 +0200
                          Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 20:55 -0300
                            Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 02:00 +0200
                        Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 19:49 -0400
              Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-03 22:43 +0000
                Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:08 +0200
                  Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-04 00:42 +0000
                    Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:12 +0200
                      Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-04 21:47 +0000
                        Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:36 +0200
            Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 21:08 -0400
              Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-03 22:37 +0000
                Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 20:50 -0400
    Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-02 14:35 +0200
      Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-02 15:08 +0100
        Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-02 21:06 +0200
          Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 16:41 -0400
            Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 08:09 +0200
              Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:13 -0400
          Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:08 -0400
          Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 11:15 +0100
            Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 19:08 +0200
              Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 19:51 +0100
                Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 21:01 +0200
                  Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 14:15 -0700
                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 18:22 -0400
                      Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 15:41 -0700
                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 19:56 -0400
                          Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:58 -0700
                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:08 -0400
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:21 -0700
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:27 -0400
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:34 -0700
                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 21:20 -0400
                                      Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 19:17 -0700
                                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 20:45 -0700
                                          Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 21:30 -0700
                                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:34 +0200
                                              Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 09:52 -0700
                                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:39 +0200
                                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 19:50 +0200
                                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-04 08:27 -0400
                                          Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 09:47 -0700
                                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 19:44 +0200
                                              Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 11:08 -0700
                                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 22:53 +0200
                                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 14:29 -0700
                                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-05 21:54 +0200
                                              Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 19:48 +0100
                          Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:05 -0400
                            Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:24 -0700
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:32 -0400
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:34 -0700
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 21:54 -0400
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 21:25 -0400
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:37 -0700
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 21:57 -0400
                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 19:23 -0700
                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-06 21:58 +0200
                                      Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-06 17:19 -0700
                                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 17:28 +0200
                                          Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-07 09:02 -0700
                                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 19:20 +0200
                                              Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 19:24 +0200
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 18:41 -0700
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 18:31 -0700
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:46 -0700
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 20:09 -0700
                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 20:47 -0700
                        Re: Usefulness of "final" Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-04-04 00:42 -0500
                          Re: Usefulness of "final" paul.cager@gmail.com - 2013-04-04 01:55 -0700
                            Re: Usefulness of "final" Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:45 +0200
                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 00:46 +0200
                      Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:10 -0700
                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:25 +0200
                          Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:44 -0700
                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:57 +0200
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:19 -0700
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:35 +0200
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 10:34 -0700
                                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:43 +0200
                                      Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 16:22 -0700
                                      Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-04 16:49 -0700
                                        Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 18:21 -0700
                                          Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-04 18:49 -0700
                                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 05:30 -0300
                            Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:10 -0400
                              Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:29 -0700
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 02:53 +0200
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Jim Janney <jjanney@shell.xmission.com> - 2013-04-04 13:51 -0600
                                Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 13:31 +0200
                                  Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-06 10:50 -0700
                  Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 09:09 +0100
                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 05:37 -0300
                      Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 06:10 -0300
                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 19:40 -0300
                          Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 05:44 -0300
                            Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-05 14:08 +0100
                              Re: arrays and variables Lew <lewbloch@gmail.com> - 2013-04-05 13:33 -0700
                                Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 09:11 +0100
                                  Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 15:20 +0200
                                    Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 16:25 +0100
                                      Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 17:50 +0200
                                        Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 18:13 +0100
                                          Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-06 14:32 -0300
                                Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 15:02 +0200
                            Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 22:12 -0300
                      Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 10:35 +0100
                        Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:02 +0200
                          Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 13:41 +0100
                    Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 13:53 +0200
                Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 23:05 +0200
        Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-02 22:09 +0200
        Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:03 -0400
        Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-06 21:39 +0200
          Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-07 01:08 +0200
          Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-06 22:15 -0700
            Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 08:48 +0100
              Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-07 12:32 -0700
                Re: Inserting In a List "John B. Matthews" <nospam@nospam.invalid> - 2013-04-07 21:06 -0400
                Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-08 08:40 +0100
          Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 08:55 +0100
            Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 17:54 +0200
              Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 19:53 +0100
                Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-07 17:58 -0300
                Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-08 08:28 +0200
                  Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-08 08:54 +0100
                    Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-08 19:13 +0200
                Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-12 20:58 +0200
                  Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-12 13:17 -0700
              Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-07 12:40 -0700
                Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-12 20:47 +0200
                  Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-12 13:14 -0700
    Re: Inserting In a List Steven Simpson <ss@domain.invalid> - 2013-04-02 13:53 +0100
    Re: Inserting In a List Roedy Green <see_website@mindprod.com.invalid> - 2013-04-02 07:10 -0700
    Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-02 10:46 -0700
      Re: Inserting In a List markspace <markspace@nospam.nospam> - 2013-04-02 11:28 -0700
        Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 16:00 -0400
    Re: Inserting In a List subhabangalore@gmail.com - 2013-04-03 01:47 -0700
      Re: Inserting In a List Steven Simpson <ss@domain.invalid> - 2013-04-03 10:35 +0100

Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9  Next page →


#23240

FromArved Sandstrom <asandstrom2@eastlink.ca>
Date2013-04-03 20:30 -0300
Message-ID<PY27t.335812$Hq1.238472@newsfe23.iad>
In reply to#23236
On 04/03/2013 07:54 PM, Joerg Meier wrote:
> On Wed, 03 Apr 2013 18:09:36 -0300, Arved Sandstrom wrote:
>
>> If we're going to be pedantic I might as well add that I wouldn't myself
>> say that Java has ArrayLists or HashMaps either. I consider "Java" to be
>> the language. If we're going to talk official libraries you'd have to
>> refer to a specific version of J2SE/Java SE or J2EE/Java EE, for example.
>
> You can feel free to say whatever you want, but lets be realistic: the
> majority of people will say "Java has" for stuff in the JCL, and "Java
> doesn't have" for stuff not in the JCL. And I am 99% certain that if I had
> asked you any of the examples above, you would have said "No, Java doesn't
> have a val data type", and you would have says "Yes, Java has a hash map,
> it's java.util.HashMap".
>
> You can be pedantic all you want, but I would argue that "stuff in the JCL"
> is the definition used by the vast majority of people and really the only
> one that makes much sense.
[ SNIP ]

I'm probably not most people. I can do very little of my professional 
Java work using just the Java language and only official Java platform 
libraries. So I value 3rd party offerings very highly.

As for the questions, what are Java primitives if not value types? And I 
very likely wouldn't say that Java has a hash map, honestly; it's too 
ingrained in me that "Java" is the language only. I think similarly with 
every other language + platform I can think of: C# is a .NET language, 
the .NET framework is actually what supplies the libraries. Haskell is a 
language, GHC and other environments supply many libraries. Etc.

But I'll concede that I'm not the vast majority of people. A lot of 
people in that vast majority have also been often wrong when they 
conflate an API supplied by the Java platform and an implementation 
thereof, and happily believe that "Java" is providing all of it.

AHS

[toc] | [prev] | [next] | [standalone]


#23241

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-04 01:35 +0200
Message-ID<mthyt0h70k18.mgvglepn8e4c.dlg@40tude.net>
In reply to#23240
On Wed, 03 Apr 2013 20:30:53 -0300, Arved Sandstrom wrote:

> On 04/03/2013 07:54 PM, Joerg Meier wrote:
>> On Wed, 03 Apr 2013 18:09:36 -0300, Arved Sandstrom wrote:
>>> If we're going to be pedantic I might as well add that I wouldn't myself
>>> say that Java has ArrayLists or HashMaps either. I consider "Java" to be
>>> the language. If we're going to talk official libraries you'd have to
>>> refer to a specific version of J2SE/Java SE or J2EE/Java EE, for example.
>> You can feel free to say whatever you want, but lets be realistic: the
>> majority of people will say "Java has" for stuff in the JCL, and "Java
>> doesn't have" for stuff not in the JCL. And I am 99% certain that if I had
>> asked you any of the examples above, you would have said "No, Java doesn't
>> have a val data type", and you would have says "Yes, Java has a hash map,
>> it's java.util.HashMap".

>> You can be pedantic all you want, but I would argue that "stuff in the JCL"
>> is the definition used by the vast majority of people and really the only
>> one that makes much sense.
> [ SNIP ]

> I'm probably not most people. I can do very little of my professional 
> Java work using just the Java language and only official Java platform 
> libraries. So I value 3rd party offerings very highly.

Using a lot of JavaEE, I'm right there with you. But I wouldn't say
RestEASY or Jackson are part of Java any more than I would say Firefox is
part of Windows.

> As for the questions, what are Java primitives if not value types? And I 

val data types != value types, a val type is a variable type that can be
used like:

for (val file : fileList) { ... // val is of type File here }

Basically an inferred type.

> very likely wouldn't say that Java has a hash map, honestly; it's too 
> ingrained in me that "Java" is the language only. I think similarly with 

So you would say that Java has ArrayMap, but not a hash map. You need to
pick one side to disagree with me on, it seems ;-)

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23244

FromArved Sandstrom <asandstrom2@eastlink.ca>
Date2013-04-03 20:55 -0300
Message-ID<1k37t.253567$wI7.80525@newsfe15.iad>
In reply to#23241
On 04/03/2013 08:35 PM, Joerg Meier wrote:
> On Wed, 03 Apr 2013 20:30:53 -0300, Arved Sandstrom wrote:
>
>> On 04/03/2013 07:54 PM, Joerg Meier wrote:
>>> On Wed, 03 Apr 2013 18:09:36 -0300, Arved Sandstrom wrote:
>>>> If we're going to be pedantic I might as well add that I wouldn't myself
>>>> say that Java has ArrayLists or HashMaps either. I consider "Java" to be
>>>> the language. If we're going to talk official libraries you'd have to
>>>> refer to a specific version of J2SE/Java SE or J2EE/Java EE, for example.
>>> You can feel free to say whatever you want, but lets be realistic: the
>>> majority of people will say "Java has" for stuff in the JCL, and "Java
>>> doesn't have" for stuff not in the JCL. And I am 99% certain that if I had
>>> asked you any of the examples above, you would have said "No, Java doesn't
>>> have a val data type", and you would have says "Yes, Java has a hash map,
>>> it's java.util.HashMap".
>
>>> You can be pedantic all you want, but I would argue that "stuff in the JCL"
>>> is the definition used by the vast majority of people and really the only
>>> one that makes much sense.
>> [ SNIP ]
>
>> I'm probably not most people. I can do very little of my professional
>> Java work using just the Java language and only official Java platform
>> libraries. So I value 3rd party offerings very highly.
>
> Using a lot of JavaEE, I'm right there with you. But I wouldn't say
> RestEASY or Jackson are part of Java any more than I would say Firefox is
> part of Windows.
>
>> As for the questions, what are Java primitives if not value types? And I
>
> val data types != value types, a val type is a variable type that can be
> used like:
>
> for (val file : fileList) { ... // val is of type File here }
>
> Basically an inferred type.

OK, I misconstrued your use of the term "val". Sure, like "var" and 
"val" in various languages. Yes, we don't have that in Java.

>> very likely wouldn't say that Java has a hash map, honestly; it's too
>> ingrained in me that "Java" is the language only. I think similarly with
>
> So you would say that Java has ArrayMap, but not a hash map. You need to
> pick one side to disagree with me on, it seems ;-)
>
> Liebe Gruesse,
> 		Joerg
>
I used the term "Java" initially because I do recognize that most folks 
use it exactly the way you say, even though I don't. But you'll recall 
that very quickly after I made my distinction.

So truthfully I'd have to say that Java has neither, not by my usage.

I don't actually beat people up over this, you know. :-) It doesn't 
exactly usually come up, someone just asks does anyone know a class or 
classes that does such and such, and someone else suggests a library. If 
it's 3rd party they'll say so, otherwise they just usually say it's 
package such-and-such.

AHS

[toc] | [prev] | [next] | [standalone]


#23248

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-04 02:00 +0200
Message-ID<1veb4yg7nf9ph$.1ts3z12wsifuu$.dlg@40tude.net>
In reply to#23244
On Wed, 03 Apr 2013 20:55:40 -0300, Arved Sandstrom wrote:

> On 04/03/2013 08:35 PM, Joerg Meier wrote:
>> On Wed, 03 Apr 2013 20:30:53 -0300, Arved Sandstrom wrote:
>>> As for the questions, what are Java primitives if not value types? And I
>> val data types != value types, a val type is a variable type that can be
>> used like:

>> for (val file : fileList) { ... // val is of type File here }

>> Basically an inferred type.
> OK, I misconstrued your use of the term "val". Sure, like "var" and 
> "val" in various languages. Yes, we don't have that in Java.

Actually, we do - if you count third party libraries ;-)

> So truthfully I'd have to say that Java has neither, not by my usage.

Then we just use the term differently. I'm alright with that.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23243

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-04-03 19:49 -0400
Message-ID<515cc016$0$32106$14726298@news.sunsite.dk>
In reply to#23240
On 4/3/2013 7:30 PM, Arved Sandstrom wrote:
> On 04/03/2013 07:54 PM, Joerg Meier wrote:
>> On Wed, 03 Apr 2013 18:09:36 -0300, Arved Sandstrom wrote:
>>
>>> If we're going to be pedantic I might as well add that I wouldn't myself
>>> say that Java has ArrayLists or HashMaps either. I consider "Java" to be
>>> the language. If we're going to talk official libraries you'd have to
>>> refer to a specific version of J2SE/Java SE or J2EE/Java EE, for
>>> example.
>>
>> You can feel free to say whatever you want, but lets be realistic: the
>> majority of people will say "Java has" for stuff in the JCL, and "Java
>> doesn't have" for stuff not in the JCL. And I am 99% certain that if I
>> had
>> asked you any of the examples above, you would have said "No, Java
>> doesn't
>> have a val data type", and you would have says "Yes, Java has a hash map,
>> it's java.util.HashMap".
>>
>> You can be pedantic all you want, but I would argue that "stuff in the
>> JCL"
>> is the definition used by the vast majority of people and really the only
>> one that makes much sense.
> [ SNIP ]
>
> I'm probably not most people. I can do very little of my professional
> Java work using just the Java language and only official Java platform
> libraries. So I value 3rd party offerings very highly.

I guess most do, but that does not make anything part of Java.

> As for the questions, what are Java primitives if not value types? And I
> very likely wouldn't say that Java has a hash map, honestly; it's too
> ingrained in me that "Java" is the language only. I think similarly with
> every other language + platform I can think of: C# is a .NET language,
> the .NET framework is actually what supplies the libraries. Haskell is a
> language, GHC and other environments supply many libraries. Etc.
>
> But I'll concede that I'm not the vast majority of people. A lot of
> people in that vast majority have also been often wrong when they
> conflate an API supplied by the Java platform and an implementation
> thereof, and happily believe that "Java" is providing all of it.

I believe there are precedence for that the owner of the
Java trademark may sue someone using the name Java for something
not having all the classes in the Java library (SUN vs MS).

So I would say that:

Java = Java language + Java library + JVM

Arne

[toc] | [prev] | [next] | [standalone]


#23234

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2013-04-03 22:43 +0000
Message-ID<kjibb7$9nj$3@localhost.localdomain>
In reply to#23200
On Wed, 03 Apr 2013 02:04:19 +0200, Joerg Meier wrote:

> On Tue, 2 Apr 2013 22:52:20 +0000 (UTC), Martin Gregorie wrote:
> 
>> On Tue, 02 Apr 2013 18:22:55 -0400, Eric Sosman wrote:
>>> On 4/2/2013 5:06 PM, Martin Gregorie wrote:
>>>>[...]
>>>> Its also not clear to me whether the OP is expecting some form of
>>>> sorted list of filenames. If he is expecting that, it would be best
>>>> to use a TreeMap<String> rather than an ArrayList<String> to store
>>>> the filenames.
>>>      Is there a reason to prefer TreeMap (or other SortedMap) over
>>> accumulate-disordered-and-sort-afterward?
>> I think so, yes, because none of File's list() and listFiles() methods
>> guarantee the order of the returned files. By using TreeMap or
>> equivalent the OP gets the sort for free, should it be required.
> 
> For free ?
>
I meant in terms of coding effort.

> The cost is just distributed amongst the insert calls, and is
> likely considerably higher than with an unsorted list that has a single
> sort call once it is filled.
>
Not necessarily so (see above) and that's why I specified a TreeMap 
rather than any other type of ordered map because of the relative drop in 
access costs as the collection size increases.

> SortedMaps are for things that need sorting
> accessible before all elements are inserted
>
And isn't the case with the TreeMap either - red-black binary trees have 
rather nice characteristics there.

> Java doesn't have ArrayMaps.
>
Yeah, I meant ArrayList and should have been obvious from the context 
provided by the OP.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#23237

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-04 01:08 +0200
Message-ID<qn8nxbe8ddqw.as3lqwtl6ezx$.dlg@40tude.net>
In reply to#23234
On Wed, 3 Apr 2013 22:43:51 +0000 (UTC), Martin Gregorie wrote:

> On Wed, 03 Apr 2013 02:04:19 +0200, Joerg Meier wrote:
>> On Tue, 2 Apr 2013 22:52:20 +0000 (UTC), Martin Gregorie wrote:
>>> On Tue, 02 Apr 2013 18:22:55 -0400, Eric Sosman wrote:
>>>> On 4/2/2013 5:06 PM, Martin Gregorie wrote:
>>>>>[...]
>>>>> Its also not clear to me whether the OP is expecting some form of
>>>>> sorted list of filenames. If he is expecting that, it would be best
>>>>> to use a TreeMap<String> rather than an ArrayList<String> to store
>>>>> the filenames.
>>>>      Is there a reason to prefer TreeMap (or other SortedMap) over
>>>> accumulate-disordered-and-sort-afterward?
>>> I think so, yes, because none of File's list() and listFiles() methods
>>> guarantee the order of the returned files. By using TreeMap or
>>> equivalent the OP gets the sort for free, should it be required.
>> For free ?
> I meant in terms of coding effort.

In terms of coding effort, it's one single line.

>> The cost is just distributed amongst the insert calls, and is
>> likely considerably higher than with an unsorted list that has a single
>> sort call once it is filled.
> Not necessarily so (see above) and that's why I specified a TreeMap 
> rather than any other type of ordered map because of the relative drop in 
> access costs as the collection size increases.

A TreeMap has a higher access cost than an ArrayList. It's O(log(n)) for
both get and put, whereas ArrayList's is O(1).

>> SortedMaps are for things that need sorting
>> accessible before all elements are inserted
> And isn't the case with the TreeMap either - red-black binary trees have 
> rather nice characteristics there.

Which are nevertheless still only in the best case scenario as good as the
alternative, and never better.

>> Java doesn't have ArrayMaps.
> Yeah, I meant ArrayList and should have been obvious from the context 
> provided by the OP.

Not really. Since you want access by key, it makes no sense to use an
ArrayList at all. But I suppose your original point, then, was correct: a
TreeMap would indeed be superiour to storing logical map data in an
ArrayList - I'm not even sure how you would fit both key and value into an
ArrayList. Was your alternative to using a Map to make a patchwork Entry
class to put keys and values in, and then make an ArrayList of those ?

Because if it was, I can think of plenty more scenarios that would be worse
than storing things in a TreeMap. Storing them in a String, for example.
But just because Strings suck to store map data in doesn't mean everyone
who wants to store map data should therefore use a TreeMap.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23260

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2013-04-04 00:42 +0000
Message-ID<kjiia3$9nj$5@localhost.localdomain>
In reply to#23237
On Thu, 04 Apr 2013 01:08:15 +0200, Joerg Meier wrote:

> On Wed, 3 Apr 2013 22:43:51 +0000 (UTC), Martin Gregorie wrote:
> 
>> On Wed, 03 Apr 2013 02:04:19 +0200, Joerg Meier wrote:
>>> On Tue, 2 Apr 2013 22:52:20 +0000 (UTC), Martin Gregorie wrote:
>>>> On Tue, 02 Apr 2013 18:22:55 -0400, Eric Sosman wrote:
>>>>> On 4/2/2013 5:06 PM, Martin Gregorie wrote:
>>>>>>[...]
>>>>>> Its also not clear to me whether the OP is expecting some form of
>>>>>> sorted list of filenames. If he is expecting that, it would be best
>>>>>> to use a TreeMap<String> rather than an ArrayList<String> to store
>>>>>> the filenames.
>>>>>      Is there a reason to prefer TreeMap (or other SortedMap) over
>>>>> accumulate-disordered-and-sort-afterward?
>>>> I think so, yes, because none of File's list() and listFiles()
>>>> methods guarantee the order of the returned files. By using TreeMap
>>>> or equivalent the OP gets the sort for free, should it be required.
>>> For free ?
>> I meant in terms of coding effort.
> 
> In terms of coding effort, it's one single line.
>
Fair enough - unless, of course a new coder tries to sort the ArrayList 
rather than using one of the standard SortedMaps. I note that there are 
only two and that, while ConcurrentSkipListMap is obviously faster than 
TreeMap for insert/amend/delete operations it would seem to be much 
slower at producing ordered lists.

> A TreeMap has a higher access cost than an ArrayList. It's O(log(n)) for
> both get and put, whereas ArrayList's is O(1).
>
For individual items that's true, but if the list is being updated, even 
at a low rate, then ordered access will need to at least check for out of 
order data before anything gets retrieved. Thats an overhead that any 
structure that preserves order through updates doesn't have.

> Not really. Since you want access by key, it makes no sense to use an
> ArrayList at all.
>
Which is where I came in: the OP had said that he wanted to get a String 
containing a list of filenames that he represented as 

"filename1,filename2,filename3,...." 

which at least suggests that the filenames should be ordered. 

That is why I suggested that if that's what he wanted he should be using 
a TreeMap rather than an ArrayList.

 > a TreeMap would indeed be superiour to storing logical map data in an
> ArrayList - I'm not even sure how you would fit both key and value into
> an ArrayList. Was your alternative to using a Map to make a patchwork
> Entry class to put keys and values in, and then make an ArrayList of
> those ?
> 
I didn't suggest any alternative and never intended to, but you can see 
somebody throwing the list of filenames into an ArrayList and then 
running a bubble sort against the array. Ugly, I know, and bubble sorts 
are horridly inefficient, but there's very little code in one. More to 
the point, this would be a very natural approach for anybody coming from 
a high level language background, e.g. Python, Perl, C, BASIC, PL/1, 
COBOL,... doing exactly this.
 
> Because if it was, I can think of plenty more scenarios that would be
> worse than storing things in a TreeMap. Storing them in a String, for
> example. But just because Strings suck to store map data in doesn't mean
> everyone who wants to store map data should therefore use a TreeMap.
> 
Indeed.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#23293

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-04 14:12 +0200
Message-ID<1d0nym8s0i3yr$.1jzthqetk39xc.dlg@40tude.net>
In reply to#23260
On Thu, 4 Apr 2013 00:42:43 +0000 (UTC), Martin Gregorie wrote:

> On Thu, 04 Apr 2013 01:08:15 +0200, Joerg Meier wrote:
>> In terms of coding effort, it's one single line.
> Fair enough - unless, of course a new coder tries to sort the ArrayList 
> rather than using one of the standard SortedMaps. I note that there are 
> only two and that, while ConcurrentSkipListMap is obviously faster than 
> TreeMap for insert/amend/delete operations it would seem to be much 
> slower at producing ordered lists.

Again: sorting an ArrayList is one single line. Collections.sort(list);, if
I recall correctly. I'm sure you could endure a new coder doing that.

>> A TreeMap has a higher access cost than an ArrayList. It's O(log(n)) for
>> both get and put, whereas ArrayList's is O(1).
> For individual items that's true, but if the list is being updated, even 
> at a low rate, then ordered access will need to at least check for out of 
> order data before anything gets retrieved. Thats an overhead that any 
> structure that preserves order through updates doesn't have.

I will not argue with that. It's what I initially said sorted lists are for
in the first place - maintaining order on a dynamic list. But in this case
there was no dynamic list. The list was built once and then not modified
again.

>> Not really. Since you want access by key, it makes no sense to use an
>> ArrayList at all.
> Which is where I came in: the OP had said that he wanted to get a String 
> containing a list of filenames that he represented as 

> "filename1,filename2,filename3,...." 

> which at least suggests that the filenames should be ordered. 

> That is why I suggested that if that's what he wanted he should be using 
> a TreeMap rather than an ArrayList.

And I still don't see why he would want to, considering that a TreeMap
would at best be the same speed as an ArrayList, and usually slower.

>  > a TreeMap would indeed be superiour to storing logical map data in an
>> ArrayList - I'm not even sure how you would fit both key and value into
>> an ArrayList. Was your alternative to using a Map to make a patchwork
>> Entry class to put keys and values in, and then make an ArrayList of
>> those ?
> I didn't suggest any alternative and never intended to, but you can see 
> somebody throwing the list of filenames into an ArrayList and then 
> running a bubble sort against the array. Ugly, I know, and bubble sorts 
> are horridly inefficient, but there's very little code in one. More to 
> the point, this would be a very natural approach for anybody coming from 
> a high level language background, e.g. Python, Perl, C, BASIC, PL/1, 
> COBOL,... doing exactly this.

Writing your own list algorithm instead of using one provided would be a
natural approach for someone coming from a high level language background ?
What ? Is this CS first semester homework or something ?

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23324

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2013-04-04 21:47 +0000
Message-ID<kjksck$v1q$1@localhost.localdomain>
In reply to#23293
On Thu, 04 Apr 2013 14:12:35 +0200, Joerg Meier wrote:

> What ? Is this CS first semester homework or something ?
>
My guess is that its exactly that. 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#23326

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-05 00:36 +0200
Message-ID<8opx8bejs1d2$.tratabdla8mo$.dlg@40tude.net>
In reply to#23324
On Thu, 4 Apr 2013 21:47:00 +0000 (UTC), Martin Gregorie wrote:

> On Thu, 04 Apr 2013 14:12:35 +0200, Joerg Meier wrote:
>> What ? Is this CS first semester homework or something ?
> My guess is that its exactly that.

I took you to be talking about things at your work place or whatever.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23204

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2013-04-02 21:08 -0400
Message-ID<kjfv9v$5go$1@dont-email.me>
In reply to#23198
On 4/2/2013 6:52 PM, Martin Gregorie wrote:
> On Tue, 02 Apr 2013 18:22:55 -0400, Eric Sosman wrote:
>
>> On 4/2/2013 5:06 PM, Martin Gregorie wrote:
>>> [...]
>>> Its also not clear to me whether the OP is expecting some form of
>>> sorted list of filenames. If he is expecting that, it would be best to
>>> use a TreeMap<String> rather than an ArrayList<String> to store the
>>> filenames.
>>
>>       Is there a reason to prefer TreeMap (or other SortedMap) over
>> accumulate-disordered-and-sort-afterward?
>>
> I think so, yes, because none of File's list() and listFiles() methods
> guarantee the order of the returned files. By using TreeMap or equivalent
> the OP gets the sort for free, should it be required.

     "For free" seems to have swept a few coins under the rug.
The sort is by no means "free," since computational effort is
expended in producing it.  My question is why one should prefer
keep-it-always-sorted-even-during-the-accumulation-phase over
just-let-the-chips-fall-and-sort-them-later.  It seems to me the
latter is likely to be cheaper in both time and memory, and that
the one extra line of code ("Collections.sort(list)") is not an
overwhelming burden on the programmer.

> I use it a lot, both for that and because accessing stored objects by key
> from a TreeMap is almost certainly faster than scanning an ArrayMap
> unless it contains very few objects indeed.

     Sorry: "ArrayMap"?

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#23232

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2013-04-03 22:37 +0000
Message-ID<kjiavf$9nj$2@localhost.localdomain>
In reply to#23204
On Tue, 02 Apr 2013 21:08:26 -0400, Eric Sosman wrote:

> On 4/2/2013 6:52 PM, Martin Gregorie wrote:
>> On Tue, 02 Apr 2013 18:22:55 -0400, Eric Sosman wrote:
>>
>>> On 4/2/2013 5:06 PM, Martin Gregorie wrote:
>>>> [...]
>>>> Its also not clear to me whether the OP is expecting some form of
>>>> sorted list of filenames. If he is expecting that, it would be best
>>>> to use a TreeMap<String> rather than an ArrayList<String> to store
>>>> the filenames.
>>>
>>>       Is there a reason to prefer TreeMap (or other SortedMap) over
>>> accumulate-disordered-and-sort-afterward?
>>>
>> I think so, yes, because none of File's list() and listFiles() methods
>> guarantee the order of the returned files. By using TreeMap or
>> equivalent the OP gets the sort for free, should it be required.
> 
>      "For free" seems to have swept a few coins under the rug.
> The sort is by no means "free," since computational effort is expended
> in producing it.
>
Sure, it may be more expensive from the computational aspect, but its 
free functionality from the coder's viewpoint.

> My question is why one should prefer
> keep-it-always-sorted-even-during-the-accumulation-phase over
> just-let-the-chips-fall-and-sort-them-later.  It seems to me the latter
> is likely to be cheaper in both time and memory, and that the one extra
> line of code ("Collections.sort(list)") is not an overwhelming burden on
> the programmer.
>
I think rather that its computationally expensive if its holding a fairly 
small collection of objects that is undergoing fast turnover and little 
or no keyed retrieval or updating.

As soon as the volume gets very large the usual red-black binary tree 
becomes rather cheap in terms of keyed access (a miss - the worst case - 
needs only 24 key comparisons to search a collection of 16 million items) 
and maintaining the ordered collection and/or updating it shares the same 
low cost for large collections - and additionally you never need to sort 
it.


>> I use it a lot, both for that and because accessing stored objects by
>> key from a TreeMap is almost certainly faster than scanning an ArrayMap
>> unless it contains very few objects indeed.
> 
>      Sorry: "ArrayMap"?
>
I meant ArrayList - my bad.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#23262

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2013-04-03 20:50 -0400
Message-ID<kjiik2$inc$1@dont-email.me>
In reply to#23232
On 4/3/2013 6:37 PM, Martin Gregorie wrote:
> On Tue, 02 Apr 2013 21:08:26 -0400, Eric Sosman wrote:
>
>> On 4/2/2013 6:52 PM, Martin Gregorie wrote:
>>>[...]
>>> I use it a lot, both for that and because accessing stored objects by
>>> key from a TreeMap is almost certainly faster than scanning an ArrayMap
>>> unless it contains very few objects indeed.
>>
>>       Sorry: "ArrayMap"?
>>
> I meant ArrayList - my bad.

     Okay, I still don't understand: How does "accessing stored
objects by key" pertain to an ArrayList, or to any List?  You
can hunt through a List to find an element equal to a search
object (or having some specified relation to it), but "by key?"
There's nothing in the List abstraction to distinguish "key"
from "value" from "haddocks' eyes:" Something's in the List or
it ain't, and that's all.

     For my part, I think that if you want to list a directory's
content in some sorted order, the preferred approach is to form
a List of the contents, paying no attention to order, and then
sort it at the end.  Spending extra time and memory computing
intermediate results that you won't use seems pointless.  YMMV.

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#23180

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-04-02 14:35 +0200
Message-ID<19un43xj77bua.vw45l4e2wshi.dlg@40tude.net>
In reply to#23175
On Tue, 2 Apr 2013 03:11:53 -0700 (PDT), subhabangalore@gmail.com wrote:

> I am taking out the files in my desktop folder, as,

> [...]

> I am getting name of files individually but I want to see them as the whole bunch like,

> myList=["string1","string2","string3",...."StringN"]

You need to move the list assignment out of the loop, like so:

final File folder = new File("G:\\Media\\TV Show");
final ArrayList<String> myList = new ArrayList<String>();
for (final File name : folder.listFiles()) {
	final String s1 = name.toString();
	System.out.println("####" + s1);
	System.out.print(name);
	myList.add(s1);
}

Otherwise, you create a new, empty list for every file name, and delete the
previous one.

You can then print out your list like so:

System.out.println(myList);

Which is really short hand for the more generic version:

System.out.println(Arrays.toString(myList.toArray()));

> My aim is to check the names then in another for loop and if match is not found with some defined name update the list.

It's really not clear to me what you mean by that. You will need to restate
it or explain it in more detail.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#23184

Fromlipska the kat <"nospam at neversurrender dot co dot uk">
Date2013-04-02 15:08 +0100
Message-ID<ntKdnSTV5a3le8fMnZ2dnUVZ8kmdnZ2d@bt.com>
In reply to#23180
On 02/04/13 13:35, Joerg Meier wrote:
> On Tue, 2 Apr 2013 03:11:53 -0700 (PDT), subhabangalore@gmail.com wrote:
>
>> I am taking out the files in my desktop folder, as,
>
>> [...]
>
>> I am getting name of files individually but I want to see them as the whole bunch like,
>
>> myList=["string1","string2","string3",...."StringN"]
>
> You need to move the list assignment out of the loop, like so:
>
> final File folder = new File("G:\\Media\\TV Show");
> final ArrayList<String>  myList = new ArrayList<String>();
> for (final File name : folder.listFiles()) {
> 	final String s1 = name.toString();
> 	System.out.println("####" + s1);
> 	System.out.print(name);
> 	myList.add(s1);
> }

Just as a matter of interest what's with all the finals

particularly

for (final File name : folder.listFiles())

Despite initial appearances this is indeed legal as the
assignment is made multiple times but from the same statement.

Given that the final keyword is, aside from a flag to the compiler for 
possible optimization, largely documentary, what is the point of making 
name final.

In fact what does peppering the code with finals do to make it easily 
understandable to an inexperienced developer ?

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun

[toc] | [prev] | [next] | [standalone]


#23188 — Usefulness of "final" (Was: Re: Inserting In a List)

FromRobert Klemme <shortcutter@googlemail.com>
Date2013-04-02 21:06 +0200
SubjectUsefulness of "final" (Was: Re: Inserting In a List)
Message-ID<as0ohhFb3opU1@mid.individual.net>
In reply to#23184
On 04/02/2013 04:08 PM, lipska the kat wrote:

> Just as a matter of interest what's with all the finals
>
> particularly
>
> for (final File name : folder.listFiles())
>
> Despite initial appearances this is indeed legal as the
> assignment is made multiple times but from the same statement.
>
> Given that the final keyword is, aside from a flag to the compiler for
> possible optimization, largely documentary, what is the point of making
> name final.

It helps avoid accidental reassignment.  And it helps distinguish 
unchanged from changed variables.

> In fact what does peppering the code with finals do to make it easily
> understandable to an inexperienced developer ?

I believe in using "final" pretty often as it will immediately indicate 
which local variables are constant for a method call and which are 
modified all the time.  Plus, with "final" you can easier catch errors 
in control flow:

final String x;

if ( someCondition() ) {
   x = y.toString();
}
else {
   if ( someOtherCondition() ) {
     x = "foo";
   }
   // forgot the else branch here
   x = "bar";
}

System.out.println("We got " + x);

Generally I find "finally" quite useful - apparently significantly more 
useful than you do. :-)

Kind regards

	robert

[toc] | [prev] | [next] | [standalone]


#23192 — Re: Usefulness of "final" (Was: Re: Inserting In a List)

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2013-04-02 16:41 -0400
SubjectRe: Usefulness of "final" (Was: Re: Inserting In a List)
Message-ID<kjffki$2gf$1@dont-email.me>
In reply to#23188
On 4/2/2013 3:06 PM, Robert Klemme wrote:
>[...]
> I believe in using "final" pretty often as it will immediately indicate
> which local variables are constant for a method call and which are
> modified all the time. [...]

     De gustibus non disputandum est, but I think "final" should
be reserved for things that *mustn't* change, and shouldn't just
be pasted on to anything that happens to remain constant in the
code's current incarnation.  When considering a change to some
code I might see

	Thing thing = getThing();
	// ... code that doesn't happen to change `thing'

or I might see

	final Thing thing = getThing();
	// ... code that (obviously) doesn't change `thing'

In the first case I might think about inserting, say,

	if (thing == null)
	    thing = fallbackThing();

... while in the second case I wouldn't even consider it: I
would suppose that the code relied on `thing' being exactly
what getThing() had returned, perhaps in some way and for some
reason not clear to me.

     But, as I said above, de gustibus.

> Generally I find "finally" quite useful - apparently significantly more
> useful than you do. :-)

     "finally" is a Godsend -- but did you mean "final"?

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#23209 — Re: Usefulness of "final" (Was: Re: Inserting In a List)

FromRobert Klemme <shortcutter@googlemail.com>
Date2013-04-03 08:09 +0200
SubjectRe: Usefulness of "final" (Was: Re: Inserting In a List)
Message-ID<as1vcsFivmaU1@mid.individual.net>
In reply to#23192
On 02.04.2013 22:41, Eric Sosman wrote:
> On 4/2/2013 3:06 PM, Robert Klemme wrote:
>> [...]
>> I believe in using "final" pretty often as it will immediately indicate
>> which local variables are constant for a method call and which are
>> modified all the time. [...]
>
>      De gustibus non disputandum est, but I think "final" should
> be reserved for things that *mustn't* change, and shouldn't just
> be pasted on to anything that happens to remain constant in the
> code's current incarnation.  When considering a change to some
> code I might see
>
>      Thing thing = getThing();
>      // ... code that doesn't happen to change `thing'

I am so used to using "final" that this immediately makes me wonder why 
it's not final - did the author intend to not change it, forget to 
change it or forgot the "final"? :-)

> or I might see
>
>      final Thing thing = getThing();
>      // ... code that (obviously) doesn't change `thing'
>
> In the first case I might think about inserting, say,
>
>      if (thing == null)
>          thing = fallbackThing();
>
> ... while in the second case I wouldn't even consider it: I
> would suppose that the code relied on `thing' being exactly
> what getThing() had returned, perhaps in some way and for some
> reason not clear to me.
>
>      But, as I said above, de gustibus.

Maybe we're not that far apart: I make things "final" that are not 
supposed to change.  If at a later time I decide they need to change I 
remove the "final" but it reminds me that other code relies on this 
value not changing - so I can check whether the change breaks the code 
in some way.

>> Generally I find "finally" quite useful - apparently significantly more
>> useful than you do. :-)
>
>      "finally" is a Godsend -- but did you mean "final"?

Yes, of course.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#23252 — Re: Usefulness of "final" (Was: Re: Inserting In a List)

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-04-03 20:13 -0400
SubjectRe: Usefulness of "final" (Was: Re: Inserting In a List)
Message-ID<515cc5bc$0$32111$14726298@news.sunsite.dk>
In reply to#23209
On 4/3/2013 2:09 AM, Robert Klemme wrote:
> On 02.04.2013 22:41, Eric Sosman wrote:
>> On 4/2/2013 3:06 PM, Robert Klemme wrote:
>>> [...]
>>> I believe in using "final" pretty often as it will immediately indicate
>>> which local variables are constant for a method call and which are
>>> modified all the time. [...]
>>
>>      De gustibus non disputandum est, but I think "final" should
>> be reserved for things that *mustn't* change, and shouldn't just
>> be pasted on to anything that happens to remain constant in the
>> code's current incarnation.  When considering a change to some
>> code I might see
>>
>>      Thing thing = getThing();
>>      // ... code that doesn't happen to change `thing'
>
> I am so used to using "final" that this immediately makes me wonder why
> it's not final - did the author intend to not change it, forget to
> change it or forgot the "final"? :-)

Many years ago the fathers of Java designed it so that default was
var and the final modifier could change that.

They could have decide to make val default and have a nonfinal
modifier that could change that.

You are trying to code as if they had picked the second.

Arne

[toc] | [prev] | [next] | [standalone]


Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web