inputiteratoradapter.java

来自「java 的源代码」· Java 代码 · 共 45 行

JAVA
45
字号
package com.reddragon2046.base.utilities.data.collections;

import com.reddragon2046.base.utilities.data.InputIterator;
import java.util.Collection;
import java.util.List;

// Referenced classes of package com.reddragon2046.base.utilities.data.collections:
//            AbstractIteratorAdapter, IterationState, CollectionIterationState, AbstractIndexBasedIterator

public class InputIteratorAdapter extends AbstractIteratorAdapter
    implements InputIterator
{

    private InputIteratorAdapter(IterationState data)
    {
        super(data);
    }

    public static InputIterator start(Collection collection)
    {
        return new InputIteratorAdapter(CollectionIterationState.createStart(collection));
    }

    public static InputIterator finish(Collection collection)
    {
        return new InputIteratorAdapter(CollectionIterationState.createFinish(collection));
    }

    public static InputIterator atIndex(List list, int index)
    {
        return new InputIteratorAdapter(CollectionIterationState.createWithIndex(list, index));
    }

    public Object clone()
    {
        IterationState clonedState = (IterationState)getIterationData().clone();
        return new InputIteratorAdapter(clonedState);
    }

    public void remove()
    {
        throw new UnsupportedOperationException("remove not supported in InputIterator");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?