Search this API

y.io.graphml
Class Future

java.lang.Object
  extended by y.io.graphml.Future

public class Future
extends java.lang.Object

A helper holder class that can contain a getValue().

Typically hasValue() will be false until at a later point in time onValueDetermined(Object) is called and the getValue() and hasValue() properties are being updated.

 
Your browser does not support SVG content.

Constructor Summary
Future()
          Initializes a new instance of the Future class.
Future(java.lang.Object defaultValue)
          Initializes a new instance of the Future class.
 
Method Summary
 java.lang.Object getValue()
          Returns the value of this future.
 boolean hasValue()
          Gets a value indicating whether this instance has been assigned a getValue().
 void onValueDetermined(java.lang.Object value)
          Called when the value property of this future has been determined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Future

public Future()
Initializes a new instance of the Future class.


Future

public Future(java.lang.Object defaultValue)
Initializes a new instance of the Future class.

Note that hasValue() will still be false until onValueDetermined(Object) is called.

Parameters:
defaultValue - The default value.
Method Detail

getValue

public java.lang.Object getValue()
Returns the value of this future. This returned value may be a default value unless hasValue() yields true.

Returns:
The value of this future.
See Also:
hasValue()

hasValue

public boolean hasValue()
Gets a value indicating whether this instance has been assigned a getValue().

Returns:
true if this instance has been assigned a value; false otherwise.
See Also:
onValueDetermined(Object), getValue()

onValueDetermined

public void onValueDetermined(java.lang.Object value)
Called when the value property of this future has been determined.

This will set the hasValue() property to true and assign the value property.

Parameters:
value - The value.
See Also:
getValue()

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.