如何为打印添加过滤并对其进行排序

时间:2015-02-25 06:23:43

标签: java sorting filter

有点误导性的标题,但我想要做的是更改输出,以便它只会根据基于参数的过滤进行打印。如果是空的那么它会正常打印,但如果它像平台= PC那么它只会在PC上打印平台

我认为代码太多,所以http://pastebin.com/GrtJNfhv这个pastebin是我的代码

我想要的输出和欲望输出低于

输出

0:1     Quick Fingers  CastleRock     XB
2:0     Colour Demon  Cirronith     PS
1:0     Quick Fingers  Crayonbreath     PS
2:1     Quick Fingers  Deathstar     IO
1:1     Number Picker  GreenPanda     AN
1:1     Quick Fingers  Ithroeann     IO
0:1     Colour Demon  Mazzzap     AN
0:1     Number Picker  Mazzzap     AN
1:0     Quick Fingers  Mazzzap     AN
1:0     Colour Demon  Quinesia     XB
1:0     Number Picker  Quinesia     XB
1:1     Colour Demon  Redstripe     PC
1:0     Number Picker  Redstripe     PC
1:0     Quick Fingers  Redstripe     PC
1:0     Number Picker  TorpedoBear     PC
0:1     Colour Demon  VolcanoBrawler     PC
0:2     Number Picker  VolcanoBrawler     PC
0:1     Quick Fingers  VolcanoBrawler     PC

Desire输出,如果参数是platform = PC

1:1 Colour Demon Redstripe PC
0:2 Number Picker VolcanoBrawler PC
1:0 Number Picker Redstripe PC
1:0 Number Picker TorpedoBear PC
1:0 Quick Fingers Redstripe PC
0:1 Quick Fingers VolcanoBrawler PC
0:1 Colour Demon VolcanoBrawler PC

另一个问题是,如果参数具有“desc”,我如何将排序值降序为降序,所以如果args [0]是platform = PC desc它将打印所需的输出但是它按降序排列< / p>

0 个答案:

没有答案