+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.utils.datastructures;\r
+\r
+import java.util.ListIterator;\r
+\r
+public class ListIteratorAdapter<Domain, Range, I extends ListIterator<Domain>> \r
+ extends IteratorAdapter<Domain,Range,I> \r
+ implements ListIterator<Range> {\r
+\r
+ public ListIteratorAdapter(Converter<Domain,Range> converter, I iterator) {\r
+ super(converter, iterator);\r
+ }\r
+ \r
+ @Override\r
+ public void add(Range e) {\r
+ iterator.add(converter.convertFrom(e)); \r
+ }\r
+\r
+ @Override\r
+ public boolean hasPrevious() {\r
+ return iterator.hasPrevious();\r
+ }\r
+\r
+ @Override\r
+ public int nextIndex() {\r
+ return iterator.nextIndex(); \r
+ }\r
+\r
+ @Override\r
+ public Range previous() {\r
+ return converter.convertTo(iterator.previous());\r
+ }\r
+\r
+ @Override\r
+ public int previousIndex() {\r
+ return iterator.previousIndex();\r
+ }\r
+\r
+ @Override\r
+ public void set(Range e) {\r
+ iterator.set(converter.convertFrom(e));\r
+ }\r
+\r
+}\r