edu.utah.janosvm.sys
Class TeamLocal
java.lang.Object
|
+--edu.utah.janosvm.sys.TeamLocal
- public class TeamLocal
- extends java.lang.Object
A java.lang.ThreadLocal
-like class that stores data local
to a team. Users should override initialValue()
in a
subclass if they cannot control the order of get()
and
set(java.lang.Object)
invocations. The default initialValue
returns null
.
- Author:
- Tim Stack, Utah Janos Team
Method Summary |
java.lang.Object |
get()
|
protected java.lang.Object |
initialValue()
Invoked at most once if a get() is invoked
before the first invocation of set(java.lang.Object) . |
void |
set(java.lang.Object value)
|
boolean |
setOnce(java.lang.Object value)
Set a TeamLocal's value once. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TeamLocal
public TeamLocal()
initialValue
protected java.lang.Object initialValue()
- Invoked at most once if a
get()
is invoked
before the first invocation of set(java.lang.Object)
.
- Returns:
- The initial value of the TeamLocal.
get
public java.lang.Object get()
- Returns:
- The current value of the TeamLocal.
set
public void set(java.lang.Object value)
- Parameters:
value
- The value to put in the TeamLocal.
setOnce
public boolean setOnce(java.lang.Object value)
- Set a TeamLocal's value once. Any future attempts to set the value will
fail and return false.
- Parameters:
value
- The value to put in the TeamLocal.- Returns:
- True if the TeamLocal was not previously set, false otherwise.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003