Package org.ojalgo.type.function
Class ManagedConsumer<T>
- java.lang.Object
-
- org.ojalgo.type.function.ManagedConsumer<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.util.function.Consumer<T>
,AutoConsumer<T>
,AutoFunctional
final class ManagedConsumer<T> extends java.lang.Object implements AutoConsumer<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Consumer<T>
myConsumer
private Throughput
myManager
-
Fields inherited from interface org.ojalgo.type.function.AutoConsumer
NULL
-
-
Constructor Summary
Constructors Constructor Description ManagedConsumer(Throughput manager, java.util.function.Consumer<T> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
write(T item)
Write the item to the consumer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.type.function.AutoConsumer
accept, writeBatch
-
-
-
-
Field Detail
-
myConsumer
private final java.util.function.Consumer<T> myConsumer
-
myManager
private final Throughput myManager
-
-
Constructor Detail
-
ManagedConsumer
ManagedConsumer(Throughput manager, java.util.function.Consumer<T> consumer)
-
-
Method Detail
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceAutoConsumer<T>
- Throws:
java.lang.Exception
-
write
public void write(T item)
Description copied from interface:AutoConsumer
Write the item to the consumer.- Specified by:
write
in interfaceAutoConsumer<T>
- Parameters:
item
- The item to be written
-
-