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 ofAttributePath.- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.AttributePath
DELIMITER
-
-
Constructor Summary
Constructors Constructor Description AttributePathImpl()Constructor for AttributePathImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringattributeAt(int index)attributeAt.AttributePathdeepCopy()deepCopy.voidfromString(String attributePath)Converts the given attribute path as string into this attribute path.inthashCode()hashCode that combines all attributesbooleanhasSameValueAsIn(Object other)Compares the complete attribute path to another one and checks, if they have the same attributesbooleanisEmpty()isEmpty.Stringpeek()Looks at the attribute name at the end of this path without removing it from the path.StringpeekFirst()Looks at the first attribute name of this path without removing it from the path.Stringpop()Removes the attribute at the end of this path and returns that attribute name as the value of this function.StringpopFirst()Removes the first attribute of this path and returns that attribute name as the value of this function.voidpush(String attributeName)Pushes an attribute name onto the top of this path.intsize()size.StringtoString()Converts the attribute path into a string.
-
-
-
Method Detail
-
attributeAt
public String attributeAt(int index)
attributeAt.
- Specified by:
attributeAtin interfaceAttributePath- 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:
deepCopyin interfaceAttributePath- 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:
hasSameValueAsInin interfaceAttributePath- 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:
fromStringin interfaceAttributePath- Parameters:
attributePath- The attribute path as string thats overwrite this attribute path object.
-
hashCode
public int hashCode()
hashCode that combines all attributes
-
isEmpty
public boolean isEmpty()
isEmpty.
- Specified by:
isEmptyin interfaceAttributePath- 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:
peekin interfaceAttributePath- 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:
peekFirstin interfaceAttributePath- 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:
popin interfaceAttributePath- 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:
popFirstin interfaceAttributePath- 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:
pushin interfaceAttributePath- Parameters:
attributeName- the attribute name to be pushed at the end of the path.
-
size
public int size()
size.
- Specified by:
sizein interfaceAttributePath- Returns:
- the number of attributes in this attribute path
-
toString
public String toString()
Converts the attribute path into a string. The inverse method isAttributePath.fromString().- Specified by:
toStringin interfaceAttributePath- Overrides:
toStringin classObject
-
-