x10.lang
Class PlaceLocalHandle<T>

x10.lang.PlaceLocalHandle<T>
All Implemented Interfaces:
Any

final public struct class PlaceLocalHandle<T>
implements Any, Any

Declaration: PlaceLocalHandle[T]{T <: x10.lang.Object} implements x10.lang.Any, x10.lang.Any.

The primary operation on a PlaceLocalHandle is to use it to access an object
on the current place.  If the current place is not part of the distribution
over which the PlaceLocalHandle is defined, a BadPlaceException will be thrown.

A key concept for correct usage of PlaceLocalHandles is that in different places, the Handle may be mapped to distinct objects. For example (assuming >1 Place):
  val plh:PlaceLocalHandle[T] = ....;
  val obj:T = plh();
  at (here.next()) Console.out.println(plh() == obj);
may print either true or false depending on how the application is using the particular PlaceLocalHandle (mapping the same object at multiple places or mapping distinct object at each place).


Method Summary
 T operator()()
          
 Int hashCode()
          
 String toString()
          
static
<T> PlaceLocalHandle<T>
make(Dist dist, x10.lang. Fun_0_0<T> init)
          Declaration: make[T](dist:x10.array.Dist,init:()=>T){}: x10.lang.PlaceLocalHandle[T]. Create a distributed object with local state of type T at each place in the argument distribution.
static
<T> PlaceLocalHandle<T>
makeFlat(Dist dist, x10.lang. Fun_0_0<T> init)
          Declaration: makeFlat[T](dist:x10.array.Dist,init:()=>T){}: x10.lang.PlaceLocalHandle[T]. Create a distributed object with local state of type T at each place in the argument distribution.
 String typeName()
          
 Boolean equals(Any other)
          
 Boolean equals(PlaceLocalHandle<T> other)
          
 Boolean _struct_equals(Any other)
          
 Boolean _struct_equals(PlaceLocalHandle<T> other)
          
 PlaceLocalHandle<T> x10$lang$PlaceLocalHandle$$x10$lang$PlaceLocalHandle$this()
          Declaration: x10$lang$PlaceLocalHandle$$x10$lang$PlaceLocalHandle$this(): x10.lang.PlaceLocalHandle[T]{self==this(:x10.lang.PlaceLocalHandle)}. The primary operation on a PlaceLocalHandle is to use it to access an object on the current place.
 
Methods inherited from interface x10.lang.Any
toString, typeName, equals, hashCode
 

Method Detail

operator()

public final T operator()()

Returns:
the object mapped to the handle at the current place

hashCode

public final Int hashCode()


toString

public final String toString()


make

public static final <T> PlaceLocalHandle<T> make(Dist dist,
                                                 x10.lang. Fun_0_0<T> init)
Declaration: make[T](dist:x10.array.Dist,init:()=>T){}: x10.lang.PlaceLocalHandle[T].
Create a distributed object with local state of type T
at each place in the argument distribution.  The local object will be initialized
by evaluating init at each place.  When this method returns, the local objects
will be initialized and available via the returned PlaceLocalHandle instance
at every place in the distribution.

Parameters:
dist - A distribution specifiying the places where local objects should be created.
init - the initialization closure used to create the local object.
Returns:
a PlaceLocalHandle that can be used to access the local objects.

makeFlat

public static final <T> PlaceLocalHandle<T> makeFlat(Dist dist,
                                                     x10.lang. Fun_0_0<T> init)
Declaration: makeFlat[T](dist:x10.array.Dist,init:()=>T){}: x10.lang.PlaceLocalHandle[T].
Create a distributed object with local state of type T
at each place in the argument distribution.  The local object will be initialized
by evaluating init at each place.  When this method returns, the local objects
will be initialized and available via the returned PlaceLocalHandle instance
at every place in the distribution.

Require an initialization closure that does not change place asynchronously.

Parameters:
dist - A distribution specifiying the places where local objects should be created.
init - the initialization closure used to create the local object.
Returns:
a PlaceLocalHandle that can be used to access the local objects.

typeName

public final String typeName()


equals

public final Boolean equals(Any other)


equals

public final Boolean equals(PlaceLocalHandle<T> other)


_struct_equals

public final Boolean _struct_equals(Any other)


_struct_equals

public final Boolean _struct_equals(PlaceLocalHandle<T> other)


x10$lang$PlaceLocalHandle$$x10$lang$PlaceLocalHandle$this

public final PlaceLocalHandle<T> x10$lang$PlaceLocalHandle$$x10$lang$PlaceLocalHandle$this()
Declaration: x10$lang$PlaceLocalHandle$$x10$lang$PlaceLocalHandle$this(): x10.lang.PlaceLocalHandle[T]{self==this(:x10.lang.PlaceLocalHandle)}.
The primary operation on a PlaceLocalHandle is to use it to access an object
on the current place.  If the current place is not part of the distribution
over which the PlaceLocalHandle is defined, a BadPlaceException will be thrown.

A key concept for correct usage of PlaceLocalHandles is that in different places, the Handle may be mapped to distinct objects. For example (assuming >1 Place):
  val plh:PlaceLocalHandle[T] = ....;
  val obj:T = plh();
  at (here.next()) Console.out.println(plh() == obj);
may print either true or false depending on how the application is using the particular PlaceLocalHandle (mapping the same object at multiple places or mapping distinct object at each place).