private String name;
private boolean complete;
private long count;
+
+ private SearchableTag parent;
private List<SearchableTag> children;
/**
return count;
}
- /**
- * The number of items that can be found with this tag if it is searched,
- * displayable format.
- * <p>
- * Will report the number of subtags by default.
- *
- * @return the number of items
- */
- public String getCountDisplay() {
- long count = this.count;
- if (count <= 0) {
- count = children.size();
- }
-
- if (count > 999999) {
- return count / 1000000 + "M";
- }
-
- if (count > 2000) {
- return count / 1000 + "k";
- }
-
- return Long.toString(count);
- }
-
/**
* The number of items that can be found with this tag if it is searched.
*
*/
public void add(SearchableTag tag) {
children.add(tag);
+ tag.parent = this;
+ }
+
+ /**
+ * This {@link SearchableTag} parent tag, or NULL if none.
+ *
+ * @return the parent or NULL
+ */
+ public SearchableTag getParent() {
+ return parent;
}
/**
}
if (getCount() > 0) {
- rep += " (" + getCountDisplay() + ")";
+ rep += " (" + getCount() + ")";
}
if (!children.isEmpty()) {