|
JanosVM v0.6.0 Java API Documentation: Class CommSpaceHandle
edu.utah.janosvm.kit.comm.commspace
|
Fields inherited from class edu.utah.janosvm.sys.ListNode |
pred,
succ |
Constructor Summary | |
CommSpaceHandle()
Create an empty handle. |
|
CommSpaceHandle(CommSpaceHandle other)
Copy constructor. |
Method Summary | |
protected void |
bindTo(Exportable ex)
Bind this Importable to the given Exportable. |
static CommSpaceHandle |
newCommSpace(CommSpaceHandle csh,
int size)
Create a CommSpace and attach it to the given handle. |
static CommSpaceHandle |
newCommSpace(int size)
Create a new CommSpace of the given size and return a handle to it. |
CommSpaceElement |
read(int index)
Read the element at the given index. |
int |
resize(int newsize)
Resize the CommSpace pointed to by this handle to contain the given number of slots. |
int |
size()
Return the number of slots in the CommSpace pointed to by this handle. |
CommSpaceElement |
swap(int index,
CommSpaceElement elem)
Swap an element with the one currently in the given index. |
CommSpaceElement |
take(int index)
Take an element from the given index and put a null in its place. |
protected void |
unbindFrom()
Unbind this Importable from any objects its referencing. |
CommSpaceElement |
waitToTake(int index)
Wait for an element to be placed into the given index. |
void |
write(int index,
CommSpaceElement elem)
Write the given element to the given index. |
Methods inherited from class edu.utah.janosvm.sys.Importable |
copy,
finalize,
revoke,
toString |
Methods inherited from class edu.utah.janosvm.sys.ListNode |
append,
clone,
prepend,
remove |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CommSpaceHandle()
newCommSpace(CommSpaceHandle,int)
public CommSpaceHandle(CommSpaceHandle other)
other
- The handle to copy.Method Detail |
public static CommSpaceHandle newCommSpace(int size)
size
- The size of the CommSpace.public static CommSpaceHandle newCommSpace(CommSpaceHandle csh, int size)
csh
- The CommSpaceHandle to attach to the newly created
CommSpace.size
- The size of the CommSpace.protected void bindTo(Exportable ex)
ex
- The Exportable that is being imported.protected void unbindFrom()
public int size()
public int resize(int newsize)
XXX what happens when resizing to smaller than current and dropping items?
public void write(int index, CommSpaceElement elem) throws java.lang.ArrayIndexOutOfBoundsException
index
- The index in the CommSpace to write into.elem
- The element to copy into the CommSpace.public CommSpaceElement take(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- The index in the CommSpace that we should take.swap(int,CommSpaceElement)
public CommSpaceElement waitToTake(int index) throws java.lang.InterruptedException, java.lang.ArrayIndexOutOfBoundsException
index
- The index in the CommSpace that we should take.public CommSpaceElement read(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- The index in the CommSpace that we should take.public CommSpaceElement swap(int index, CommSpaceElement elem) throws java.lang.ArrayIndexOutOfBoundsException
index
- The index in the CommSpace that we should take.elem
- The element to swap into the index.
|
JanosVM v0.6.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |