Created
December 5, 2013 18:10
-
-
Save keefmarshall/7810334 to your computer and use it in GitHub Desktop.
Lambda Expression examples: Java 7 MapFileParser:
This file contains 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 void readMapFile(MapProcessor processor) throws IOException | |
{ | |
try (BufferedReader reader = new BufferedReader(new FileReader(filename))) | |
{ | |
String line = reader.readLine(); | |
while (line != null) | |
{ | |
Map<String, String> map = parseLineIntoMap(line); | |
processor.process(map); | |
line = reader.readLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment