org.jawk.intermediate
Interface Address


public interface Address

A pointer to a tuple within the list of tuples. Addresses are used for jumps, especially in reaction to conditional checks (i.e., if false, jump to else block, etc.).

Addresses have the following properties:

An address may not necessarily have an index assigned upon creation. However, upon tuple traversal, all address indexes must point to a valid tuple.

All addresses should have a meaningful label.


Method Summary
 void assignIndex(int idx)
          Set the tuple index of this address.
 int index()
           
 java.lang.String label()
          The label of the address.
 

Method Detail

label

java.lang.String label()
The label of the address. It is particularly useful when dumping tuples to an output stream.

Returns:
The label of the tuple.

assignIndex

void assignIndex(int idx)
Set the tuple index of this address. This can be defered anytime after creation of the address, but the index must be assigned prior to traversing the tuples.

Parameters:
idx - The tuple location within the tuple list (queue) for this address.

index

int index()
Returns:
The index into the tuple queue/array.