Class AttributePathImpl

java.lang.Object
de.uni_trier.wi2.procake.data.model.base.impl.AttributePathImpl
All Implemented Interfaces:
AttributePath

public class AttributePathImpl extends Object implements AttributePath
Implementation of AttributePath.
Author:
Rainer Maximini
  • Field Summary

    Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.AttributePath

    DELIMITER
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for AttributePathImpl.
  • Method Summary

    Modifier and Type
    Method
    Description
    attributeAt(int index)
    attributeAt.
    deepCopy.
    void
    fromString(String attributePath)
    Converts the given attribute path as string into this attribute path.
    int
    boolean
    Compares the complete attribute path to another one and checks, if they have the same attributes
    boolean
    isEmpty.
    Looks at the attribute name at the end of this path without removing it from the path.
    Looks at the first attribute name of this path without removing it from the path.
    pop()
    Removes the attribute at the end of this path and returns that attribute name as the value of this function.
    Removes the first attribute of this path and returns that attribute name as the value of this function.
    void
    push(String attributeName)
    Pushes an attribute name onto the top of this path.
    int
    size.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AttributePathImpl

      public AttributePathImpl()

      Constructor for AttributePathImpl.

  • Method Details

    • attributeAt

      public String attributeAt(int index)

      attributeAt.

      Specified by:
      attributeAt in interface AttributePath
      Parameters:
      index - a int
      Returns:
      Attribute name at the specified index or null if the index not exists.
    • deepCopy

      public AttributePath deepCopy()

      deepCopy.

      Specified by:
      deepCopy in interface AttributePath
      Returns:
      a new AttributePath with the same attribute names.
    • hasSameValueAsIn

      public boolean hasSameValueAsIn(Object other)
      Compares the complete attribute path to another one and checks, if they have the same attributes
      Specified by:
      hasSameValueAsIn in interface AttributePath
      Parameters:
      other - an other attribute path
      Returns:
      true, if both attribute paths have the same attributes
    • fromString

      public void fromString(String attributePath)
      Converts the given attribute path as string into this attribute path. Existing attributes are removed first.
      Specified by:
      fromString in interface AttributePath
      Parameters:
      attributePath - The attribute path as string thats overwrite this attribute path object.
    • hashCode

      public int hashCode()

      hashCode that combines all attributes

      Overrides:
      hashCode in class Object
    • isEmpty

      public boolean isEmpty()

      isEmpty.

      Specified by:
      isEmpty in interface AttributePath
      Returns:
      true if the attribute path is empty
    • peek

      public String peek()
      Looks at the attribute name at the end of this path without removing it from the path.
      Specified by:
      peek in interface AttributePath
      Returns:
      the attribute name at the end of this path
    • peekFirst

      public String peekFirst()
      Looks at the first attribute name of this path without removing it from the path.
      Specified by:
      peekFirst in interface AttributePath
      Returns:
      the attribute name at the end of this path
    • pop

      public String pop()
      Removes the attribute at the end of this path and returns that attribute name as the value of this function.
      Specified by:
      pop in interface AttributePath
      Returns:
      The attribute name at the end of this path.
    • popFirst

      public String popFirst()
      Removes the first attribute of this path and returns that attribute name as the value of this function.
      Specified by:
      popFirst in interface AttributePath
      Returns:
      The attribute name at the end of this path.
    • push

      public void push(String attributeName)
      Pushes an attribute name onto the top of this path.
      Specified by:
      push in interface AttributePath
      Parameters:
      attributeName - the attribute name to be pushed at the end of the path.
    • size

      public int size()

      size.

      Specified by:
      size in interface AttributePath
      Returns:
      the number of attributes in this attribute path
    • toString

      public String toString()

      Converts the attribute path into a string. The inverse method is AttributePath.fromString().

      Specified by:
      toString in interface AttributePath
      Overrides:
      toString in class Object