Community
Participate
Working Groups
fail();
}
@Test
public void testParentAttribute() {
String[] path = { "CPUs/0/Current_thread",
"CPUs/0",
"CPUs" };
try {
int q = ssq.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD);
for (int i = 0; i < path.length; i++) {
String name = ssq.getFullAttributePath(q);
assertEquals(path[i], name);
q = ssq.getParentAttributeQuark(q);
assertEquals(-1, q);
} catch (AttributeNotFoundException e) {
return targetNode.getQuark();
/**
* Get the parent attribute of this attribute
* @return The parent attribute
*/
public Attribute getParentAttribute() {
return this.parent;
* Get the parent quark of this attribute
* @return The quark of the parent attribute
public int getParentAttributeQuark() {
return this.parent.getQuark();
/* The methods how to access children are left to derived classes */
return listOfChildren;
* Returns the parent quark of the attribute. The root attribute
* has no parent.
*
* @param attributeQuark The quark of the attribute
* @return Quark of the parent attribute
public int getParentAttributeQuark(int quark) {
return attributeList.get(quark).getParentAttributeQuark();
private void addSubAttributes(List<Integer> list, Attribute curAttribute,
boolean recursive) {
for (Attribute childNode : curAttribute.getSubAttributes()) {
@Override
return getAttributeTree().getParentAttributeQuark(quark);
public List<Integer> getQuarks(String... pattern) {
List<Integer> quarks = new LinkedList<>();
List<String> prefix = new LinkedList<>();
String getFullAttributePath(int attributeQuark);
int getParentAttributeQuark(int attributeQuark);
* @name Query methods
-