01: /*
02: * LICENSE INFORMATION
03: * Copyright 2005-2007 by FZI (http://www.fzi.de).
04: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
05: * <OWNER> = Max Völkel
06: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
07: * <YEAR> = 2007
08: *
09: * Project information at http://semweb4j.org/rdf2go
10: */
11: package org.ontoware.rdf2go.util;
12:
13: import org.ontoware.aifbcommons.collection.ClosableIterator;
14:
15: /**
16: * A converting iterator that is closable/closeable (both is correct).
17: *
18: * You have to implement both {@link #convert(Object)} and
19: * {@link ClosableIterator#close()}.
20: *
21: * @author sauermann
22: * @param <FROM> the source class
23: * @param <TO> the target class
24: */
25: public abstract class ClosableConvertingIterator<FROM, TO> extends
26: ConvertingIterator<FROM, TO> implements ClosableIterator<TO> {
27:
28: /**
29: * The iterator takes the wrapped class and converts it to other
30: * classes on the fly.
31: * You have to implement the "convert" method, though.
32: * @param wrapped the wrapped iterator
33: */
34: public ClosableConvertingIterator(ClosableIterator<FROM> wrapped) {
35: super (wrapped);
36: }
37:
38: /**
39: * The iterator takes the wrapped class and converts it to other
40: * classes on the fly. Pass a converter that handles the conversion.
41: * @param wrapped the wrapped iterator
42: * @param converter the converter
43: */
44: public ClosableConvertingIterator(ClosableIterator<FROM> wrapped,
45: Converter<FROM, TO> converter) {
46: super(wrapped, converter);
47: }
48:
49: }
|