forked from FRC-Dozer/Dozer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SAIO
authored and
SAIO
committed
Dec 4, 2018
1 parent
7b0f6aa
commit d16badb
Showing
1 changed file
with
26 additions
and
26 deletions.
There are no files selected for viewing
52 changes: 26 additions & 26 deletions
52
src/main/java/com/zoominfo/util/yieldreturn/YieldAdapterIterator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
/** | ||
* A "yield return" implementation for Java By Jim Blackler (jimblackler@gmail.com) | ||
* | ||
* http://jimblackler.net/blog/?p=61 | ||
* http://svn.jimblackler.net/jimblackler/trunk/IdeaProjects/YieldAdapter/ | ||
*/ | ||
package com.zoominfo.util.yieldreturn; | ||
|
||
import java.io.Closeable; | ||
import java.util.Iterator; | ||
|
||
/** | ||
* A version of a standard Iterator<> used by the yield adapter. The only addition is a close() | ||
* function to clear resources manually when required. | ||
*/ | ||
public interface YieldAdapterIterator<T> extends Iterator<T>, Closeable { | ||
|
||
/** | ||
* Because the Yield Adapter starts a separate thread for duration of the collection, this can be | ||
* left open if the calling code only reads part of the collection. If the iterator goes out of | ||
* scope, when it is GCed its finalize() will close the collection thread. However garbage | ||
* collection is sporadic and the VM will not trigger it simply because there is a lack of | ||
* available threads. So, if a lot of partial reads are happening, it will be wise to manually | ||
* close the iterator (which will clear the resources immediately). | ||
*/ | ||
} | ||
/** | ||
* A "yield return" implementation for Java By Jim Blackler (jimblackler@gmail.com) | ||
* | ||
* http://jimblackler.net/blog/?p=61 | ||
* http://svn.jimblackler.net/jimblackler/trunk/IdeaProjects/YieldAdapter/ | ||
*/ | ||
package com.zoominfo.util.yieldreturn; | ||
|
||
import java.io.Closeable; | ||
import java.util.Iterator; | ||
|
||
/** | ||
* A version of a standard Iterator<> used by the yield adapter. The only addition is a close() | ||
* function to clear resources manually when required. | ||
*/ | ||
public interface YieldAdapterIterator<T> extends Iterator<T>, Closeable { | ||
|
||
/** | ||
* Because the Yield Adapter starts a separate thread for duration of the collection, this can be | ||
* left open if the calling code only reads part of the collection. If the iterator goes out of | ||
* scope, when it is GCed its finalize() will close the collection thread. However garbage | ||
* collection is sporadic and the VM will not trigger it simply because there is a lack of | ||
* available threads. So, if a lot of partial reads are happening, it will be wise to manually | ||
* close the iterator (which will clear the resources immediately). | ||
*/ | ||
} |