How to search by complex number queries in Java?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    How to search by complex number queries in Java?

    So I have a jTable (table model data is an arrayList) and in it there is a positive integer field. I'd like the user to filter by this field using the following type of queries:

    0-10,500,239-99999

    ranges and singles separated by dash.

    This is a common thing I've seen in application so I'm sure it's been done before.

    Anyone know what it is called? I can't seem to enter the right search terms in Google.

    Preferably if anyone can point me to some code example/tutorial on how to go about doing this?

    I'm searching my alphanumeric field like this:

    Code:
    mySorter.setRowFilter(RowFilter.regexFilter(foo.getText(),1));
    Do I need a custom RowFilter class?


    Thanks,

    Dan
Working...