Back to project page music-tag.
The source code is released under:
Apache License
If you think the Android project music-tag listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package binauld.pierre.musictag.item; //from w w w.j a v a2 s. c om import java.util.ArrayList; import java.util.List; import binauld.pierre.musictag.collection.MultipleBufferedList; /** * Represent a folder in a library. */ public abstract class NodeItem extends ChildItem { private MultipleBufferedList<LibraryItem> children; private LoadingState state; private int invalidItemCount; public NodeItem() { this(null); } public NodeItem(NodeItem parent) { this.parent = parent; this.children = new MultipleBufferedList<>(new MultipleBufferedList.ListFactory<LibraryItem>() { public List<LibraryItem> buildEmptyList() { return new ArrayList<>(); } }); this.state = LoadingState.NOT_LOADED; } @Override public boolean isAudioItem() { return false; } /** * Get the maximum number of possible children. * @return The maximum number of possible children. */ public abstract int getMaxChildren(); /** * Get the number of children node. * @return The number of children node. */ public int size() { return children.size(); } /** * Get a child. * @param i Index of the child. * @return A child. */ public LibraryItem getChild(int i) { return children.get(i); } /** * Get the loading state from the item. * @return The loading state. */ public LoadingState getState() { return state; } /** * Set the loading state to the item. * @param state The loading state. */ public void setState(LoadingState state) { this.state = state; } /** * Get the list of children for modification. * @return The list of children */ public MultipleBufferedList<LibraryItem> getChildren() { return children; } /** * Set the count of invalid item found by a loader. * @param invalidItemCount The count of invalid item found. */ public void setInvalidItemCount(int invalidItemCount) { this.invalidItemCount = invalidItemCount; } /** * Get the count of invalid item found by a loader. * @return The count of invalid item found. */ public int getInvalidItemCount() { return invalidItemCount; } }