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