edu.utah.janosvm.sys
Class TeamLocal
java.lang.Object
|
+--edu.utah.janosvm.sys.TeamLocal
- Direct Known Subclasses:
- OneWayLink_Both.LinkMapAccessor
- 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()
|
private java.lang.Object |
get(Team team)
|
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)
|
private void |
set(Team team,
java.lang.Object value)
|
boolean |
setOnce(java.lang.Object value)
Set a TeamLocal's value once. |
private boolean |
setOnce(Team team,
java.lang.Object value)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
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.
get
private java.lang.Object get(Team team)
- Parameters:
team
- The team to use as context when retrieving the local.- Returns:
- The current value of the TeamLocal.
set
private void set(Team team,
java.lang.Object value)
- Parameters:
team
- The team to use as context when setting the local.value
- The value to put in the local.
setOnce
private boolean setOnce(Team team,
java.lang.Object value)
- Parameters:
team
- The team to use as context when setting the local.value
- The value to put in the local.- Returns:
- False if the TeamLocal was not previously set, true 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