// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Positions extends ListIterator<Integer> {
// 
// 	/**
// 	 * Indicates whether the iterator moves over pattern sequences such that
// 	 * successive matched ranges do not over overlap.
// 	 *
// 	 * @return true if position matches do not overlap, false otherwise
// 	 */
// 
// 	boolean isDisjoint();
// 
// 	/**
// 	 * <p>
// 	 * The next matched position. This is equivalent to {@link #next()} but
// 	 * may be expected to be slightly more efficient, with the differences
// 	 * being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the next position, or the first invalid index if there is no
// 	 *         further position
// 	 */
// 
// 	int nextPosition();
// 
// 	/**
// 	 * <p>
// 	 * The previous matched position. This is equivalent to
// 	 * {@link #previous()} but may be expected to be slightly more
// 	 * efficient, with the differences being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the previous position, or -1 if there is no further position
// 	 */
// 
// 	int previousPosition();
// 
// 	/**
// 	 * Replaces the last match returned by the {@link #next()}/
// 	 * {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the supplied bits.
// 	 *
// 	 * @param replacement
// 	 *            the bits to replace the matched sequence
// 	 * @throws IllegalArgumentException
// 	 *             if the replacement size does not match the matched
// 	 *             sequence size
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(BitStore)
// 	 */
// 
// 	void replace(BitStore replacement);
// 
// 	/**
// 	 * Uniformly replaces the bits of last match returned by the
// 	 * {@link #next()}/ {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the specified bit value.
// 	 *
// 	 * @param bits
// 	 *            the bit value with which to replace the matched bits
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(boolean)
// 	 */
// 
// 	void replace(boolean bits);
// }


import com.tomgibara.bits.BitStore.Positions;
/*
 * Copyright 2015 Tom Gibara
 *
 * 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.tomgibara.bits;


public class ImmutableOnesTest extends ImmutableBitsTest {

	@Override
	boolean isOnes() { return true; }

	public void testPositions() {
		BitStore store = Bits.oneBits(50);
// Path: src/main/java/com/tomgibara/bits/BitStore.java
// interface Positions extends ListIterator<Integer> {
// 
// 	/**
// 	 * Indicates whether the iterator moves over pattern sequences such that
// 	 * successive matched ranges do not over overlap.
// 	 *
// 	 * @return true if position matches do not overlap, false otherwise
// 	 */
// 
// 	boolean isDisjoint();
// 
// 	/**
// 	 * <p>
// 	 * The next matched position. This is equivalent to {@link #next()} but
// 	 * may be expected to be slightly more efficient, with the differences
// 	 * being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the next position, or the first invalid index if there is no
// 	 *         further position
// 	 */
// 
// 	int nextPosition();
// 
// 	/**
// 	 * <p>
// 	 * The previous matched position. This is equivalent to
// 	 * {@link #previous()} but may be expected to be slightly more
// 	 * efficient, with the differences being that:
// 	 *
// 	 * <ul>
// 	 * <li>The position is returned as a primitive is returned, not a boxed
// 	 * primitive.
// 	 * <li>If there's no position, the value of {@link BitStore#size()} is
// 	 * returned instead of an exception being raised.
// 	 * </ul>
// 	 *
// 	 * <p>
// 	 * Otherwise, the effect of calling the method is the same.
// 	 *
// 	 * @return the previous position, or -1 if there is no further position
// 	 */
// 
// 	int previousPosition();
// 
// 	/**
// 	 * Replaces the last match returned by the {@link #next()}/
// 	 * {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the supplied bits.
// 	 *
// 	 * @param replacement
// 	 *            the bits to replace the matched sequence
// 	 * @throws IllegalArgumentException
// 	 *             if the replacement size does not match the matched
// 	 *             sequence size
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(BitStore)
// 	 */
// 
// 	void replace(BitStore replacement);
// 
// 	/**
// 	 * Uniformly replaces the bits of last match returned by the
// 	 * {@link #next()}/ {@link #nextPosition()} and {@link #previous()}/
// 	 * {@link #previousPosition()} methods, with the specified bit value.
// 	 *
// 	 * @param bits
// 	 *            the bit value with which to replace the matched bits
// 	 * @throws IllegalStateException
// 	 *             if the underlying bit store is immutable, or if no call
// 	 *             to {@link #previous()} or {@link #next()} has been made
// 	 * @see DisjointMatches#replaceAll(boolean)
// 	 */
// 
// 	void replace(boolean bits);
// }


// Path: src/test/java/com/tomgibara/bits/ImmutableOnesTest.java
import com.tomgibara.bits.BitStore.Positions;

/*
 * Copyright 2015 Tom Gibara
 *
 * 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.tomgibara.bits;


public class ImmutableOnesTest extends ImmutableBitsTest {

	@Override
	boolean isOnes() { return true; }

	public void testPositions() {
		BitStore store = Bits.oneBits(50);
		Positions ps = store.ones().positions();