📄 applyiterator.java
字号:
// **********************************************************************// <copyright>// BBN Technologies// 10 Moulton Street// Cambridge, MA 02138// (617) 873-8000// // Copyright (C) BBNT Solutions LLC. All rights reserved.// </copyright>// **********************************************************************// $Source: /cvs/distapps/openmap/src/vpfservlet/WEB-INF/src/com/bbn/openmap/vpfservlet/ApplyIterator.java,v $// $Revision: 1.2.2.2 $ $Date: 2005/08/11 21:03:08 $ $Author: dietrick $// **********************************************************************package com.bbn.openmap.vpfservlet;import java.util.Iterator;/** * An Iterator subclass that wraps another iterator. Each element * returned by the iterator is the result of calling Applyable.apply() * on the current element of the underlying iterator. */public class ApplyIterator implements Iterator { /** the iterator to be wrapped */ final private Iterator wrapped; /** the Applyable object to use before returning each element */ final private Applyable applier; /** * Constructor * * @param iter the iterator to wrap, may not be null * @param apply the Applyable object to use in next(), may not be * null */ public ApplyIterator(Iterator iter, Applyable apply) { wrapped = iter; applier = apply; } public boolean hasNext() { return wrapped.hasNext(); } public Object next() { return applier.apply(wrapped.next()); } public void remove() { wrapped.remove(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -