Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7930
| Date | 2011-09-12 19:30 -0400 |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: StatsTable object |
| References | <9ac3f834-0633-434c-86b0-49ed543f3e81@z18g2000yqb.googlegroups.com> |
| Message-ID | <4e6e962d$0$309$14726298@news.sunsite.dk> (permalink) |
| Organization | SunSITE.dk - Supporting Open source |
On 9/12/2011 4:23 AM, bob wrote:
> I'm creating an object that represents a table of sports stats with
> the player name as the first column and stat name as first row.
> Here's an example:
>
> Touchdowns Yards Rushing Yards Passing
> Dan Marino 2 200 55
> Chad Henne 8 700 53
> Brett Favre 7 300 44
> Emmitt Smith 4 400 108
>
> What's the best way to represent this object in Java?
>
> I'm thinking of this:
>
> class StatsTable {
> vector<String> strings;
> int numColumns;
> int numRows;
> }
>
> What do you all think of this representation? I think it would be
> better if it had a more 2-dimensional feel, but I don't want to
> complicate things.
I agree with several of the other posters:
- Stats class with 4 properties
- StatsTable class with an ArrayList<Stats>
Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar
StatsTable object bob <bob@coolgroups.com> - 2011-09-12 01:23 -0700
Re: StatsTable object Jeff Higgins <jeff@invalid.invalid> - 2011-09-12 10:00 -0400
Re: StatsTable object Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 18:53 +0200
Re: StatsTable object Jeff Higgins <jeff@invalid.invalid> - 2011-09-12 13:09 -0400
Re: StatsTable object Jeff Higgins <jeff@invalid.invalid> - 2011-09-12 13:23 -0400
Re: StatsTable object markspace <-@.> - 2011-09-12 09:03 -0700
Re: StatsTable object Jeff Higgins <jeff@invalid.invalid> - 2011-09-12 12:59 -0400
Re: StatsTable object markspace <-@.> - 2011-09-12 09:58 -0700
Re: StatsTable object Lew <lewbloch@gmail.com> - 2011-09-12 15:30 -0700
Re: StatsTable object Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 18:52 +0200
Re: StatsTable object Knute Johnson <nospam@knutejohnson.com> - 2011-09-12 10:17 -0700
Re: StatsTable object Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 19:19 +0200
Re: StatsTable object Arne Vajhøj <arne@vajhoej.dk> - 2011-09-12 19:28 -0400
Re: StatsTable object Arne Vajhøj <arne@vajhoej.dk> - 2011-09-12 19:30 -0400
csiph-web