Interface AttributePath
- All Known Implementing Classes:
AttributePathImpl
public interface AttributePath
An AttriutePath represents a list of attribute names.
AggregateClass
es can contain as attribute
values further AggregateClasses. To identifiy an attribute, it is necessary to specify all
attribute names from the top AggregateClass. This path of attributes can be expressed using the
AttributePath.
- Author:
- Rainer Maximini
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributeAt
(int index) attributeAt.deepCopy()
deepCopy.void
fromString
(String attributePath) Converts the given attribute path as string into this attribute path.boolean
hasSameValueAsIn
(Object other) Compares the complete attribute path to another one and checks, if they have the same attributesboolean
isEmpty()
isEmpty.peek()
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.popFirst()
Removes the first attribute of this path and returns that attribute name as the value of this function.void
Pushes an attribute name onto the top of this path.int
size()
size.toString()
-
Field Details
-
DELIMITER
ConstantDELIMITER="::"
- See Also:
-
-
Method Details
-
attributeAt
attributeAt.
- Parameters:
index
- a int- Returns:
- Attribute name at the specified index or null if the index not exists.
-
deepCopy
AttributePath deepCopy()deepCopy.
- Returns:
- a new AttributePath with the same attribute names.
-
fromString
Converts the given attribute path as string into this attribute path. Existing attributes are removed first.- Parameters:
attributePath
- The attribute path as string thats overwrite this attribute path object.
-
isEmpty
boolean isEmpty()isEmpty.
- Returns:
- true if the attribute path is empty
-
peek
String peek()Looks at the attribute name at the end of this path without removing it from the path.- Returns:
- the attribute name at the end of this path
-
peekFirst
String peekFirst()Looks at the first attribute name of this path without removing it from the path.- Returns:
- the attribute name at the end of this path
-
pop
String pop()Removes the attribute at the end of this path and returns that attribute name as the value of this function.- Returns:
- The attribute name at the end of this path.
-
popFirst
String popFirst()Removes the first attribute of this path and returns that attribute name as the value of this function.- Returns:
- The attribute name at the end of this path.
-
push
Pushes an attribute name onto the top of this path.- Parameters:
attributeName
- the attribute name to be pushed at the end of the path.
-
size
int size()size.
- Returns:
- the number of attributes in this attribute path
-
hasSameValueAsIn
Compares the complete attribute path to another one and checks, if they have the same attributes- Parameters:
other
- an other attribute path- Returns:
- true, if both attribute paths have the same attributes
-
toString
String toString()Converts the attribute path into a string. The inverse method is
AttributePath.fromString()
.
-