com.jrockit.memleak.util
Class Present<V>

java.lang.Object
  extended by com.jrockit.memleak.util.Present<V>
Type Parameters:
V -
All Implemented Interfaces:
java.util.concurrent.Future<V>

public class Present<V>
extends java.lang.Object
implements java.util.concurrent.Future<V>

Trivial Future wrapper for a value. This Future implementation will never throw any exceptions.

Author:
mpersson

Constructor Summary
Present(V result)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 V get()
           
 V get(long timeout, java.util.concurrent.TimeUnit unit)
           
 boolean isCancelled()
           
 boolean isDone()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Present

public Present(V result)
Parameters:
result -
Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface java.util.concurrent.Future<V>

get

public V get()
Specified by:
get in interface java.util.concurrent.Future<V>

get

public V get(long timeout,
             java.util.concurrent.TimeUnit unit)
Specified by:
get in interface java.util.concurrent.Future<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface java.util.concurrent.Future<V>

isDone

public boolean isDone()
Specified by:
isDone in interface java.util.concurrent.Future<V>


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.