Basic functional style question

mohan.radhakrishnan at mohan.radhakrishnan at
Tue Nov 26 22:27:48 PST 2013


This is a question from a user. I am trying to jdk 8 to parse a file and 
apply a regex on it.

public class GCLogParser {

    private void readFile() throws IOException {

        Stream<String> s = Files.lines(get(("D:\\GC 
Analysis\\usage.txt")), UTF_8);
        s.forEach( this::parse  );

    public static void parseDocument(  Parseable parser,
 String data){
    private void parse( String data ){

        Scanner s = new Scanner( data );

    public static void main( String... argv ) throws IOException {
        new GCLogParser().readFile();

    public interface Parseable{
         void apply( String s);

This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.  If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit us at

More information about the lambda-dev mailing list