// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/AbstractMatchProcessor.java
// public abstract class AbstractMatchProcessor implements MatchProcessor {
// 
//     /**
//      * @param matchResult
//      *            the {@link MatchResult} given to the {@link MatchProcessor}.
//      * @param newMatchEnd
//      *            the position of the end of the matched string after the character buffer is modified.
//      * @param continueMatching
//      *            See {@link MatchProcessorResult#isContinueMatching()}
//      * @return Returns a {@link MatchProcessorResult} that cannot cause an endless loop.
//      */
//     protected MatchProcessorResult createResult(MatchResult matchResult, int newMatchEnd, boolean continueMatching) {
// 
//         int matchStart = matchResult.start();
//         int matchEnd = matchResult.end();
// 
//         // if the empty string is matched, then we increase the position
//         // to avoid endless loops
//         // (compare to Matcher.find() where we see the following code:
//         // int i = last; if(i == first) i++;
//         // in words: set the *from* for the next match at the
//         // end of the last match. if this is equal to the start
//         // of the last match (a match on the empty string(, then
//         // increase the *from* to avoid endless loops)
//         int offset = matchStart == matchEnd ? 1 : 0;
// 
//         return new MatchProcessorResult(newMatchEnd + offset, continueMatching);
//     }
// 
// }
// 
// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/MatchProcessor.java
// public interface MatchProcessor {
// 
//     /**
//      * Processes the given match. The match processor is allowed to modify the given character buffer but it must not
//      * modify the characters before the first modifiable character in the buffer because the characters before that
//      * position are considered unmodifiable.
//      * 
//      * @param characterBuffer
//      *            Must not be <code>null</code>.
//      * @param firstModifiableCharacterInBuffer
//      *            In comparison to the parameter with the same name in
//      *            {@link Modifier#modify(StringBuilder, int, boolean)} this parameter might be the position at the end
//      *            of the previous match if there is one. (TODO should we rather pass two parameters like 'first char'
//      *            and 'end of previous match' instead of this single parameter?)
//      * @param matchResult
//      *            The match that is found in the given character buffer. Must not be <code>null</code>.
//      * @return Returns an {@link MatchProcessorResult object} that describes where to continue the matching.
//      */
//     public MatchProcessorResult process(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
//             MatchResult matchResult);
// 
// }
// 
// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/MatchProcessorResult.java
// public class MatchProcessorResult {
// 
//     /**
//      * A position in the character buffer. The characters before this position shall be considered unmodifiable by the
//      * {@link RegexModifier}.
//      * <p>
//      * This position must not be smaller than the (originally) first modifiable character in the buffer.
//      * <p>
//      * This position must not be greater than the size of the buffer plus one.
//      * <p>
//      * EXAMPLE: This position is equal to the size of the buffer plus one if the empty string is matched (and processed)
//      * and the matching shall be continued after the first character after the empty match. This avoids endless loops.
//      */
//     private int firstModifiableCharacterInBuffer;
// 
//     /**
//      * True if the matching shall be continued using the characters that already available in the buffer.
//      */
//     private boolean continueMatching;
// 
//     /**
//      * @param firstModifiableCharacterInBuffer
//      * @param continueMatching
//      */
//     public MatchProcessorResult(int firstModifiableCharacterInBuffer, boolean continueMatching) {
//         super();
//         this.firstModifiableCharacterInBuffer = firstModifiableCharacterInBuffer;
//         this.continueMatching = continueMatching;
//     }
// 
//     /**
//      * @return Returns the {@link #firstModifiableCharacterInBuffer}.
//      */
//     public int getFirstModifiableCharacterInBuffer() {
//         return firstModifiableCharacterInBuffer;
//     }
// 
//     /**
//      * @return Returns the {@link #continueMatching}.
//      */
//     public boolean isContinueMatching() {
//         return continueMatching;
//     }
// }


import java.util.regex.MatchResult;
import com.github.rwitzel.streamflyer.regex.AbstractMatchProcessor;
import com.github.rwitzel.streamflyer.regex.MatchProcessor;
import com.github.rwitzel.streamflyer.regex.MatchProcessorResult;

/**
 * Copyright (C) 2011 rwitzel75@googlemail.com
 *
 * 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.github.rwitzel.streamflyer.regex.addons.util;



/**
 * This {@link MatchProcessor} does not modify the stream.
 * 
 * @author rwoo
 * @since 1.1.0
 */
public class DoNothingProcessor extends AbstractMatchProcessor implements MatchProcessor {

    @Override

// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/AbstractMatchProcessor.java
// public abstract class AbstractMatchProcessor implements MatchProcessor {
// 
//     /**
//      * @param matchResult
//      *            the {@link MatchResult} given to the {@link MatchProcessor}.
//      * @param newMatchEnd
//      *            the position of the end of the matched string after the character buffer is modified.
//      * @param continueMatching
//      *            See {@link MatchProcessorResult#isContinueMatching()}
//      * @return Returns a {@link MatchProcessorResult} that cannot cause an endless loop.
//      */
//     protected MatchProcessorResult createResult(MatchResult matchResult, int newMatchEnd, boolean continueMatching) {
// 
//         int matchStart = matchResult.start();
//         int matchEnd = matchResult.end();
// 
//         // if the empty string is matched, then we increase the position
//         // to avoid endless loops
//         // (compare to Matcher.find() where we see the following code:
//         // int i = last; if(i == first) i++;
//         // in words: set the *from* for the next match at the
//         // end of the last match. if this is equal to the start
//         // of the last match (a match on the empty string(, then
//         // increase the *from* to avoid endless loops)
//         int offset = matchStart == matchEnd ? 1 : 0;
// 
//         return new MatchProcessorResult(newMatchEnd + offset, continueMatching);
//     }
// 
// }
// 
// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/MatchProcessor.java
// public interface MatchProcessor {
// 
//     /**
//      * Processes the given match. The match processor is allowed to modify the given character buffer but it must not
//      * modify the characters before the first modifiable character in the buffer because the characters before that
//      * position are considered unmodifiable.
//      * 
//      * @param characterBuffer
//      *            Must not be <code>null</code>.
//      * @param firstModifiableCharacterInBuffer
//      *            In comparison to the parameter with the same name in
//      *            {@link Modifier#modify(StringBuilder, int, boolean)} this parameter might be the position at the end
//      *            of the previous match if there is one. (TODO should we rather pass two parameters like 'first char'
//      *            and 'end of previous match' instead of this single parameter?)
//      * @param matchResult
//      *            The match that is found in the given character buffer. Must not be <code>null</code>.
//      * @return Returns an {@link MatchProcessorResult object} that describes where to continue the matching.
//      */
//     public MatchProcessorResult process(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
//             MatchResult matchResult);
// 
// }
// 
// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/MatchProcessorResult.java
// public class MatchProcessorResult {
// 
//     /**
//      * A position in the character buffer. The characters before this position shall be considered unmodifiable by the
//      * {@link RegexModifier}.
//      * <p>
//      * This position must not be smaller than the (originally) first modifiable character in the buffer.
//      * <p>
//      * This position must not be greater than the size of the buffer plus one.
//      * <p>
//      * EXAMPLE: This position is equal to the size of the buffer plus one if the empty string is matched (and processed)
//      * and the matching shall be continued after the first character after the empty match. This avoids endless loops.
//      */
//     private int firstModifiableCharacterInBuffer;
// 
//     /**
//      * True if the matching shall be continued using the characters that already available in the buffer.
//      */
//     private boolean continueMatching;
// 
//     /**
//      * @param firstModifiableCharacterInBuffer
//      * @param continueMatching
//      */
//     public MatchProcessorResult(int firstModifiableCharacterInBuffer, boolean continueMatching) {
//         super();
//         this.firstModifiableCharacterInBuffer = firstModifiableCharacterInBuffer;
//         this.continueMatching = continueMatching;
//     }
// 
//     /**
//      * @return Returns the {@link #firstModifiableCharacterInBuffer}.
//      */
//     public int getFirstModifiableCharacterInBuffer() {
//         return firstModifiableCharacterInBuffer;
//     }
// 
//     /**
//      * @return Returns the {@link #continueMatching}.
//      */
//     public boolean isContinueMatching() {
//         return continueMatching;
//     }
// }


// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/addons/util/DoNothingProcessor.java
import java.util.regex.MatchResult;
import com.github.rwitzel.streamflyer.regex.AbstractMatchProcessor;
import com.github.rwitzel.streamflyer.regex.MatchProcessor;
import com.github.rwitzel.streamflyer.regex.MatchProcessorResult;

/**
 * Copyright (C) 2011 rwitzel75@googlemail.com
 *
 * 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.github.rwitzel.streamflyer.regex.addons.util;



/**
 * This {@link MatchProcessor} does not modify the stream.
 * 
 * @author rwoo
 * @since 1.1.0
 */
public class DoNothingProcessor extends AbstractMatchProcessor implements MatchProcessor {

    @Override

    public MatchProcessorResult process(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
