Skip to content

Instantly share code, notes, and snippets.

@keefmarshall
Created December 5, 2013 18:10
Show Gist options
  • Save keefmarshall/7810334 to your computer and use it in GitHub Desktop.
Save keefmarshall/7810334 to your computer and use it in GitHub Desktop.
Lambda Expression examples: Java 7 MapFileParser:
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