* Return a String array composed of the full (absolute) path representing
* this attribute
*
- * @return
+ * @return The full attribute path elements
*/
- private String[] getFullAttribute() {
+ public @NonNull String[] getFullAttribute() {
LinkedList<String> list = new LinkedList<>();
Attribute curNode = this;
curNode = curNode.parent;
}
- return list.toArray(new String[0]);
+ return checkNotNull(list.toArray(new String[0]));
}
/**
return attributeList.get(quark).getFullAttributeName();
}
+ /**
+ * Get the full path name (as an array of path elements) of an attribute
+ * specified by a quark.
+ *
+ * @param quark
+ * The quark of the attribute
+ * @return The path elements of the full path
+ */
+ public @NonNull String[] getFullAttributePathArray(int quark) {
+ return attributeList.get(quark).getFullAttribute();
+ }
+
/**
* Debug-print all the attributes in the tree.
*
return getAttributeTree().getFullAttributeName(attributeQuark);
}
+ @Override
+ public String[] getFullAttributePathArray(int attributeQuark) {
+ return getAttributeTree().getFullAttributePathArray(attributeQuark);
+ }
+
//--------------------------------------------------------------------------
// Methods related to the storage backend
//--------------------------------------------------------------------------
*/
void dispose();
+ // ------------------------------------------------------------------------
+ // Read-only quark-getting methods
+ // ------------------------------------------------------------------------
+
/**
* Return the current total amount of attributes in the system. This is also
* equal to the quark that will be assigned to the next attribute that's
*/
int getNbAttributes();
- /**
- * @name Read-only quark-getting methods
- */
-
/**
* Basic quark-retrieving method. Pass an attribute in parameter as an array
* of strings, the matching quark will be returned.
*/
@NonNull String getFullAttributePath(int attributeQuark);
+ /**
+ * Return the full attribute path, as an array of strings representing each
+ * element.
+ *
+ * @param attributeQuark
+ * The quark of the attribute we want.
+ * @return The array of path elements
+ * @throws IndexOutOfBoundsException
+ * If the attribute quark is out of range
+ * @since 1.0
+ */
+ @NonNull String[] getFullAttributePathArray(int attributeQuark);
+
/**
* Returns the parent quark of the attribute.
*
*/
int getParentAttributeQuark(int attributeQuark);
- /**
- * @name Query methods
- */
+ // ------------------------------------------------------------------------
+ // Query methods
+ // ------------------------------------------------------------------------
/**
* Returns the current state value we have (in the Transient State) for the