CharBucket instances using a java.io.Reader in a separate thread
ConcurrentCharInputReader, CharBucket, Entry
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Thread | |
| private final ArrayBlockingQueue | |
| private final boolean | |
| private Entry | |
| private final CharBucket | |
| private Exception | |
| private boolean | |
| private final FixedInstancePool | |
| pack-priv Reader |
| Access | Constructor and Description |
|---|---|
| public | ConcurrentCharLoader(Reader
The source of characters to extract and fill reader, final int CharBucket instancesThe size of each individual bucketSize, int CharBucketThe number of bucketQuantity, boolean CharBucket instances used to extract characters from the given reader.Indicates whether to automatically close the input when closeOnStop)stopReading() is calledCreates a |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized CharBucket | |
| private int | |
| pack-priv void | |
| public void | run()
Implements java. CharBucket loading process that executes in parallel until the input is completely read.
|
| private void | |
| public void | stopReading()
Stops the |
| active | back to summary |
|---|---|
| private boolean active | |
| activeExecution | back to summary |
|---|---|
| private Thread activeExecution | |
| buckets | back to summary |
|---|---|
| private final ArrayBlockingQueue<Object> buckets | |
| closeOnStop | back to summary |
|---|---|
| private final boolean closeOnStop | |
| currentBucket | back to summary |
|---|---|
| private Entry<CharBucket> currentBucket | |
| end | back to summary |
|---|---|
| private final CharBucket end | |
| error | back to summary |
|---|---|
| private Exception error | |
| finished | back to summary |
|---|---|
| private boolean finished | |
| instances | back to summary |
|---|---|
| private final FixedInstancePool<CharBucket> instances | |
| reader | back to summary |
|---|---|
| pack-priv Reader reader | |
| ConcurrentCharLoader | back to summary |
|---|---|
| public ConcurrentCharLoader(Reader reader, final int bucketSize, int bucketQuantity, boolean closeOnStop) Creates a
| |
| nextBucket | back to summary |
|---|---|
| public synchronized CharBucket nextBucket() Returns the next available bucket. Blocks until a bucket is made available or the reading process stops.
| |
| readBucket | back to summary |
|---|---|
| private int readBucket() throws IOException, InterruptedException | |
| reportError | back to summary |
|---|---|
| pack-priv void reportError() | |
| run | back to summary |
|---|---|
| public void run() Implements java. The
| |
| setError | back to summary |
|---|---|
| private void setError(Exception e) | |
| stopReading | back to summary |
|---|---|
| public void stopReading() Stops the | |