Created
February 29, 2012 08:56
-
-
Save erikfried/1939287 to your computer and use it in GitHub Desktop.
Java scala collections comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Integer> getContinuousLessThan150DaysOfferIds(List<DbLegacyOffer> list){ | |
List<Integer> retList = new ArrayList<Integer>(); | |
for(DbLegacyOffer offer : list) { | |
if(offer.isBecomesContinous() && offer.getLength() < 150) | |
retList.add(offer.getOfferId()); | |
} | |
return retList; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val lessThan150 = allOffers.filter( offer => offer.isBecomeContinuous && offer.getLength < 150 ).map(_.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment