1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.utils.datastructures;
14 import java.util.ListIterator;
16 public class ListIteratorAdapter<Domain, Range, I extends ListIterator<Domain>>
17 extends IteratorAdapter<Domain,Range,I>
18 implements ListIterator<Range> {
20 public ListIteratorAdapter(Converter<Domain,Range> converter, I iterator) {
21 super(converter, iterator);
25 public void add(Range e) {
26 iterator.add(converter.convertFrom(e));
30 public boolean hasPrevious() {
31 return iterator.hasPrevious();
35 public int nextIndex() {
36 return iterator.nextIndex();
40 public Range previous() {
41 return converter.convertTo(iterator.previous());
45 public int previousIndex() {
46 return iterator.previousIndex();
50 public void set(Range e) {
51 iterator.set(converter.convertFrom(e));