public class StringBuilderFutureAppendable extends Object implements FutureAppendable, Future<CharSequence>
It is intended for temporary buffers when implementing nested tags.
Constructor and Description |
---|
StringBuilderFutureAppendable()
Create a new builder with a default capacity of 1024.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
FutureAppendable |
enqueueAppend(Future<CharSequence> csq)
Queue the Future<CharSequence> for append in this FutureAppendable.
|
CharSequence |
get() |
CharSequence |
get(long timeout,
TimeUnit unit) |
boolean |
hasPending()
Check if some append operations are still waiting for
FutureAppendable.performAppends() to be called. |
boolean |
isCancelled() |
boolean |
isDone() |
FutureAppendable |
performAppends()
Wait for all computation to complete and perform the pending append operations.
|
FutureAppendable |
performAppends(int timeout,
TimeUnit unit)
Wait for all computation to complete and perform the pending append operations.
|
public StringBuilderFutureAppendable()
public FutureAppendable enqueueAppend(Future<CharSequence> csq)
FutureAppendable
Caller may start computing the content of the Future parameter before or after calling this method (using other Thread) or simply wait for Future#get() to be called (deferred computation).
enqueueAppend
in interface FutureAppendable
csq
- The Future character sequence to append. If csq is null, then the four characters
"null" are appended to this FutureAppendable.public FutureAppendable performAppends() throws IOException, HttpErrorPage
FutureAppendable
performAppends
in interface FutureAppendable
IOException
HttpErrorPage
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface Future<CharSequence>
public boolean isCancelled()
isCancelled
in interface Future<CharSequence>
public boolean isDone()
isDone
in interface Future<CharSequence>
public CharSequence get() throws ExecutionException
get
in interface Future<CharSequence>
ExecutionException
public CharSequence get(long timeout, TimeUnit unit) throws ExecutionException
get
in interface Future<CharSequence>
ExecutionException
public boolean hasPending()
FutureAppendable
FutureAppendable.performAppends()
to be called.hasPending
in interface FutureAppendable
public FutureAppendable performAppends(int timeout, TimeUnit unit) throws IOException, HttpErrorPage, TimeoutException
FutureAppendable
performAppends
in interface FutureAppendable
IOException
HttpErrorPage
TimeoutException
Copyright © 2008–2018. All rights reserved.