Class Address

java.lang.Object
org.metricshub.jawk.intermediate.Address
All Implemented Interfaces:
Serializable

public class Address extends Object implements Serializable
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:

  • A name (label).
  • An index into the tuple queue.
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.

Author:
Danny Daglas
See Also:
  • Constructor Details

    • Address

      public Address(String lbl)
  • Method Details

    • label

      public 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

      public void assignIndex(int index)
      Set the tuple index of this address. This can be deferred anytime after creation of the address, but the index must be assigned prior to traversing the tuples.
      Parameters:
      index - The tuple location within the tuple list (queue) for this address.
    • index

      public int index()

      index.

      Returns:
      The index into the tuple queue/array.
    • toString

      public String toString()
      Overrides:
      toString in class Object