com.jrockit.memleak.value
Class KnownResult<V>

java.lang.Object
  extended by com.jrockit.memleak.value.KnownResult<V>
Type Parameters:
V -
All Implemented Interfaces:
IResult<V>

public class KnownResult<V>
extends java.lang.Object
implements IResult<V>

Author:
mpersson

Constructor Summary
KnownResult(V result)
           
 
Method Summary
 V get()
          The actual result.
 long getChangeTime()
          Get the time stamp of when this result last changed state.
 boolean isDone()
          Returns true if this task completed.
 boolean isDone(java.lang.Object notificationToken)
          Checks if the result is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnownResult

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

getChangeTime

public long getChangeTime()
Description copied from interface: IResult
Get the time stamp of when this result last changed state. In other words: If IResult.isDone() is false, returns the time when the request was sent. If IResult.isDone() is true, returns the time when the response was received.

Specified by:
getChangeTime in interface IResult<V>
Returns:
a time stamp (in milliseconds since 1970-01-01)

isDone

public boolean isDone()
Description copied from interface: IResult
Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

Specified by:
isDone in interface IResult<V>
Returns:
true if this task completed.

isDone

public boolean isDone(java.lang.Object notificationToken)
Description copied from interface: IResult
Checks if the result is available. If so, simply returns true. Otherwise, notificationToken is added to the token set that will be given to notification listeners once the result is available. And false is returned.

Specified by:
isDone in interface IResult<V>
Returns:
true if this task completed.

get

public V get()
Description copied from interface: IResult
The actual result.

Specified by:
get in interface IResult<V>
Returns:
the result.


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