Class Tag<T>

Type Parameters:
T - the type of the data associated with the tag
All Implemented Interfaces:
Serializable, Comparable<Tag<?>>

public final class Tag<T>
extends Object
implements Comparable<Tag<?>>, Serializable
A tag object useful as a key in heterogeneous maps. Carries static type information in its type parameter, which is expected to correspond to the type of the item retrieved from the map.

Tags are also used by hash-join and co-group builder objects. The same tag supplied to the builder is used to retrieve the data from the heterogeneous maps (ItemsByTag) that appear in the output.

See Also:
Serialized Form
  • Method Details

    • tag

      public static <T> Tag<T> tag​(int index)
      Returns a tag object associated with the specified index. The tag's type parameter is inferred from the call site. The method will not necessarily create a new tag object.
    • index

      public int index()
      Returns the index associated with this tag. It can refer to the index of a contributing stream in a hash-join or co-group operation, or to the index used internally to store the data associated with the tag.
    • tag0

      public static <T> Tag<T> tag0()
      Returns the tag constant TAG_0.
    • tag1

      public static <T> Tag<T> tag1()
      Returns the tag constant TAG_1.
    • tag2

      public static <T> Tag<T> tag2()
      Returns the tag constant TAG_2.
    • equals

      public boolean equals​(Object obj)
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object
    • compareTo

      public int compareTo​(Tag<?> that)
      Specified by:
      compareTo in interface Comparable<T>
    • toString

      public String toString()
      toString in class Object