public final class TargetInterfaceAcc
extends java.lang.Object
Target.ACC target.
Provides instant read and write on the accumulator register.
| Constructor and Description |
|---|
TargetInterfaceAcc(Machine machine) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginRead()
Begin a reading operation on the target.
|
boolean |
beginWrite(short value)
Begin a writing operation on the target.
|
boolean |
canTransfer()
Whether the target can transfer data, i.e.
|
protected Machine |
getMachine() |
protected MachineState |
getState() |
boolean |
isReading()
Whether the target is currently being read from.
|
boolean |
isWriting()
Whether the target is currently being written to.
|
short |
read()
Finish a read operation by fetching the data made available from the
represented target.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonWriteCompletepublic TargetInterfaceAcc(Machine machine)
public boolean beginWrite(short value)
TargetInterface
Make sure not to call this if the target is already being written to, or
an exception will be thrown. Use TargetInterface.isWriting() to check for this.
value - the value to write to the target.public boolean isWriting()
TargetInterface
This is true as soon as TargetInterface.beginWrite(short) was called and
until TargetInterface.read() was called to finish or cancel the operation,
unless the operation was completed synchronously, in which case
TargetInterface.beginWrite(short) returned true.
public void beginRead()
TargetInterface
Make sure not to call this if the target is already being read from, or
an exception will be thrown. Use TargetInterface.isReading() to check for this.
public boolean isReading()
TargetInterface
This is true as soon as TargetInterface.beginRead() was called and
until TargetInterface.read() was called to finish the operation.
public boolean canTransfer()
TargetInterfaceTargetInterface.read() can be called.
Note that this is not equivalent to TargetInterface.isReading() &&
TargetInterface.isWriting(). Depending on the target type, this may be
only true in the first update after that has been true and
later, but it may also be true right away or always.
public short read()
TargetInterface
Make sure not to call this if the target is not in the correct state, or
an exception will be thrown. use TargetInterface.canTransfer() to check for this.
public java.lang.String toString()
toString in class java.lang.Objectprotected Machine getMachine()
protected MachineState getState()