4 * Created on October 18, 2006, 11:17 AM
6 * To change this template, choose Tools | Template Manager
7 * and open the template in the editor.
10 package galago
.tupleflow
;
12 import java
.io
.IOException
;
13 import java
.util
.Comparator
;
19 public class Unique
<T
> implements Processor
<T
> {
20 Comparator
<T
> sameObject
;
22 Processor
<T
> processor
;
24 /** Creates a new instance of Unique */
25 public Unique( Comparator
<T
> sameObject
, Processor
<T
> processor
) {
26 this.sameObject
= sameObject
;
28 this.processor
= processor
;
31 public void process( T object
) throws IOException
{
32 if( last
!= null && 0 == sameObject
.compare( object
, last
) )
35 processor
.process(object
);
39 public void close() throws IOException
{