Sorting set of data

Discussion in 'Java' started by Su Man, Apr 6, 2004.

  1. Su Man

    Su Man Guest

    Hi All,

    I have set of values arranged as rows and columns.

    Say 5 rows and 4 columns.

    Is there any mechanism through which I can sort ( preferably using
    HashMap/array list ) them by a preferred column?
    Some times by Column 3, sometimes by Column 1 etc.

    I have data in an array list.
    Array list contains hash maps. Each hash map represent a row.
    Each hash map holding its column values as name-value pair.

    Can you please focus some light on this?

    Thanks,
    Su man
    Su Man, Apr 6, 2004
    #1
    1. Advertising

  2. Su Man

    Roedy Green Guest

    On Tue, 6 Apr 2004 10:47:03 +0530, "Su Man" <> wrote
    or quoted :

    >Is there any mechanism through which I can sort ( preferably using
    >HashMap/array list ) them by a preferred column?
    >Some times by Column 3, sometimes by Column 1 etc.


    see http://mindprod.com/jgloss/sort.html

    and http://mindprod.com/jgloss/comparator.html
    for a very general purpose Comparator that lets you select the column.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Apr 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    631
  2. Replies:
    2
    Views:
    1,401
    James Kanze
    Jul 6, 2010
  3. Jason
    Replies:
    0
    Views:
    370
    Jason
    Oct 4, 2006
  4. Tom Kirchner

    sorting by multiple criterias (sub-sorting)

    Tom Kirchner, Oct 11, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    463
    Michael Budash
    Oct 11, 2003
  5. Íéêüëáïò Êïýñáò

    Sorting a set works, sorting a dictionary fails ?

    Íéêüëáïò Êïýñáò, Jun 10, 2013, in forum: Python
    Replies:
    12
    Views:
    139
    Ulrich Eckhardt
    Jun 10, 2013
Loading...

Share This Page