// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/core/Modifier.java
// public interface Modifier {
// 
//     /**
//      * Processes the characters in the given character buffer, i.e. deletes or replaces or inserts characters, or keeps
//      * the characters as they are.
//      * 
//      * @param characterBuffer
//      *            The next characters provided from the modifiable stream. It contains the modifiable characters,
//      *            (optionally) preceded by unmodifiable characters.
//      *            <p>
//      *            The modifier can modify the content of the buffer as appropriate the modifier must not modify the
//      *            unmodifiable characters, i.e. the characters before position
//      *            <code>firstModifiableCharacterInBufferIndex</code> must not be modified.
//      *            <p>
//      *            Your modifier should manage the {@link StringBuilder#capacity() capacity} of the buffer on its own -
//      *            as the optimal management of the capacity depends on the specific purpose of the modifier.
//      *            <p>
//      *            The given buffer must be never null.
//      * @param firstModifiableCharacterInBuffer
//      *            index of the first modifiable character in the buffer. The index of the first character in the buffer
//      *            is zero. If there is not modifiable character in the buffer, then this value is equal the length of
//      *            the buffer.
//      * @param endOfStreamHit
//      *            True if no more characters can be read from the stream, i.e. the character buffer contains the all the
//      *            characters up to the end of the stream.
//      * @return Returns an object that defines how {@link ModifyingReader} or {@link ModifyingWriter} shall behave before
//      *         calling {@link Modifier#modify(StringBuilder, int, boolean)} again.
//      */
//     public AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
//             boolean endOfStreamHit);
// }
// 
// Path: streamflyer-experimental/src/main/java/com/github/rwitzel/streamflyer/experimental/range2/RangeFilterModifier.java
// @Deprecated
// public class RangeFilterModifier extends HandlerAwareModifier {
// 
//     public RangeFilterModifier(String startRegex, String endRegex, boolean includeStartToken, boolean includeEndToken,
//             boolean initiallyBetweenStartAndEnd, int minimumLengthOfLookBehind, int newNumberOfChars) {
//         super();
// 
//         // define the behaviour for matched tokens and noMatches
//         RangeFilterHandler handler = new RangeFilterHandler(initiallyBetweenStartAndEnd, includeStartToken,
//                 includeEndToken, minimumLengthOfLookBehind, newNumberOfChars);
// 
//         // define the tokens
//         List<Token> tokens = new ArrayList<Token>();
//         tokens.add(new Token("Start", startRegex));
//         tokens.add(new Token("End", endRegex));
// 
//         // initialize the handler aware modifier
//         initialize(tokens, handler, minimumLengthOfLookBehind, newNumberOfChars);
//     }
// 
// }


import com.github.rwitzel.streamflyer.core.Modifier;
import com.github.rwitzel.streamflyer.experimental.range2.RangeFilterModifier;

/**
 * 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.experimental.range2;


/**
 * Tests {@link RangeFilterModifier}.
 * 
 * @author rwoo
 * 
 */
public class RangeFilterModifierTest extends com.github.rwitzel.streamflyer.experimental.range.RangeFilterModifierTest {

    @Override
    protected Modifier createModifier(String startTag, String endTag, boolean includeStart, boolean includeEnd,
            boolean initiallyOn) {


// Path: streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/core/Modifier.java
// public interface Modifier {
// 
//     /**
//      * Processes the characters in the given character buffer, i.e. deletes or replaces or inserts characters, or keeps
//      * the characters as they are.
//      * 
//      * @param characterBuffer
//      *            The next characters provided from the modifiable stream. It contains the modifiable characters,
//      *            (optionally) preceded by unmodifiable characters.
//      *            <p>
//      *            The modifier can modify the content of the buffer as appropriate the modifier must not modify the
//      *            unmodifiable characters, i.e. the characters before position
//      *            <code>firstModifiableCharacterInBufferIndex</code> must not be modified.
//      *            <p>
//      *            Your modifier should manage the {@link StringBuilder#capacity() capacity} of the buffer on its own -
//      *            as the optimal management of the capacity depends on the specific purpose of the modifier.
//      *            <p>
//      *            The given buffer must be never null.
//      * @param firstModifiableCharacterInBuffer
//      *            index of the first modifiable character in the buffer. The index of the first character in the buffer
//      *            is zero. If there is not modifiable character in the buffer, then this value is equal the length of
//      *            the buffer.
//      * @param endOfStreamHit
//      *            True if no more characters can be read from the stream, i.e. the character buffer contains the all the
//      *            characters up to the end of the stream.
//      * @return Returns an object that defines how {@link ModifyingReader} or {@link ModifyingWriter} shall behave before
//      *         calling {@link Modifier#modify(StringBuilder, int, boolean)} again.
//      */
//     public AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
//             boolean endOfStreamHit);
// }
// 
// Path: streamflyer-experimental/src/main/java/com/github/rwitzel/streamflyer/experimental/range2/RangeFilterModifier.java
// @Deprecated
// public class RangeFilterModifier extends HandlerAwareModifier {
// 
//     public RangeFilterModifier(String startRegex, String endRegex, boolean includeStartToken, boolean includeEndToken,
//             boolean initiallyBetweenStartAndEnd, int minimumLengthOfLookBehind, int newNumberOfChars) {
//         super();
// 
//         // define the behaviour for matched tokens and noMatches
//         RangeFilterHandler handler = new RangeFilterHandler(initiallyBetweenStartAndEnd, includeStartToken,
//                 includeEndToken, minimumLengthOfLookBehind, newNumberOfChars);
// 
//         // define the tokens
//         List<Token> tokens = new ArrayList<Token>();
//         tokens.add(new Token("Start", startRegex));
//         tokens.add(new Token("End", endRegex));
// 
//         // initialize the handler aware modifier
//         initialize(tokens, handler, minimumLengthOfLookBehind, newNumberOfChars);
//     }
// 
// }


// Path: streamflyer-experimental/src/test/java/com/github/rwitzel/streamflyer/experimental/range2/RangeFilterModifierTest.java
import com.github.rwitzel.streamflyer.core.Modifier;
import com.github.rwitzel.streamflyer.experimental.range2.RangeFilterModifier;

/**
 * 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.experimental.range2;


/**
 * Tests {@link RangeFilterModifier}.
 * 
 * @author rwoo
 * 
 */
public class RangeFilterModifierTest extends com.github.rwitzel.streamflyer.experimental.range.RangeFilterModifierTest {

    @Override
    protected Modifier createModifier(String startTag, String endTag, boolean includeStart, boolean includeEnd,
            boolean initiallyOn) {


        return new RangeFilterModifier(startTag, endTag, includeStart, includeEnd, initiallyOn, 1, 2048);
