Class AttributeGroup

java.lang.Object
ca.uqac.lif.cep.tuples.AttributeGroup

public class AttributeGroup extends Object
A group of attributes taken from the merging of one or more tuples. Each attribute is identified by the name of the trace it comes from.
Author:
Sylvain Hallé
  • Constructor Details

    • AttributeGroup

      public AttributeGroup(String[] names)
      Create a new attribute group, by specifying the names given to each tuple.
      Parameters:
      names - The names
  • Method Details

    • add

      public void add(int position, Tuple t)
      Add a tuple in a specific position in the group
      Parameters:
      position - The position. This value should be at least 0 and at most the size of the name array minus one.
      t - The tuple to add
    • getAttribute

      public Object getAttribute(String trace_name, String attribute_name)
      Gets the value of an attribute by giving its name and the of the tuple it comes from.
      Parameters:
      trace_name - The tuple name. Can be null.
      attribute_name - The attribute name
      Returns:
      The value of the attribute, or null if not found
    • getAttribute

      public Object getAttribute(String attribute_name)
      Gets the value of an attribute by giving its name. The method will look in all tuples for an attribute with that name, and return the first found.
      Parameters:
      attribute_name - The attribute name
      Returns:
      The value of the attribute, or null if not found
    • toString

      public String toString()
      Overrides:
      toString in class Object