Class Tag<T>

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

    public final class Tag<T>
    extends java.lang.Object
    implements java.lang.Comparable<Tag<?>>, java.io.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.

    Since:
    Jet 3.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Tag<?> that)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      int index()
      Returns the index associated with this tag.
      static <T> Tag<T> tag​(int index)
      Returns a tag object associated with the specified index.
      static <T> Tag<T> tag0()
      Returns the tag constant TAG_0.
      static <T> Tag<T> tag1()
      Returns the tag constant TAG_1.
      static <T> Tag<T> tag2()
      Returns the tag constant TAG_2.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • 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​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object