/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.pedrogomez.bowling;

/**
 * Main class of Bowling kata. This class has the responsibility of instrument all the application dependencies and
 * create a facade to offer the implementation using a single access point. This class will get a string parameter
 * with a valid sequence of rolls for one line and will return an integer with the score.
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class Bowling {
    
    /**
     * Calculate the score of a roll sequence for a bowling match.
     *
     * @param rolls valid sequence of rolls in one line.
     * @return calculated score.
     */
    public int getScore(String rolls) {
        return -1;
    }

}

@@ -638,16 +638,98 @@
 wling;%0A%0A
+import java.util.Collection;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A
 /**%0A * M
@@ -1115,20 +1115,182 @@
 wling %7B%0A
+%0A
     
+/*%0A     * Attributes%0A     */%0A    private LineParser lineParser;%0A%0A    /*%0A     * Constructor%0A     */%0A    public Bowling() %7B%0A        initializeLineParser();%0A    %7D%0A%0A
 %0A    /**
@@ -1514,17 +1514,634 @@
     
-return -1
+List%3CFrame%3E frames = lineParser.parse(rolls);%0A        return getScore(frames);%0A    %7D%0A%0A    /*%0A     * Auxiliary methods%0A     */%0A%0A    private void initializeLineParser() %7B%0A        Collection%3CFrameParser%3E parsers = new LinkedList%3CFrameParser%3E();%0A        parsers.add(new StrikeFrameParser());%0A        parsers.add(new SpareFrameParser());%0A        parsers.add(new NormalFrameParser());%0A        parsers.add(new ZeroFrameParser());%0A        lineParser = new LineParser(parsers);%0A    %7D%0A%0A    private int getScore(final List%3CFrame%3E frames) %7B%0A        //Pending implementation using a BowlingMatch entity to calculate score.%0A        return 0
 ;%0A  

Integrate LineParser and FrameParsers into Bowling class