您的位置:首页 > 其它

嵌套类引用实例化的外部类的方法

2011-10-21 16:49 176 查看
class:java.util.HashMap

line:814

HashMap.this.removeEntryForKey(k)

public class HashMap<K,V>
extends AbstractMap<K,V>
implements Map<K,V>, Cloneable, Serializable
{
...
final Entry<K,V> removeEntryForKey(Object key) {...}
private abstract class HashIterator<E> implements Iterator<E> {
Entry<K,V> next;    // next entry to return
int expectedModCount;    // For fast-fail
int index;        // current slot
Entry<K,V> current;    // current entry

HashIterator() {...}

public final boolean hasNext() {...}

final Entry<K,V> nextEntry() {...}

public void remove() {
if (current == null)
throw new IllegalStateException();
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
Object k = current.key;
current = null;
HashMap.this.removeEntryForKey(k);
expectedModCount = modCount;
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐