Class SetListUtil


  • public final class SetListUtil
    extends java.lang.Object
    This utility class collects several methods used to explore SetLists. Quite some of these could well be implemented in the SetListEntry class, but they've been deliberately implemented in a separate utility class to minimize code changes in the set list classes and thus minimize the risk of introducing serialization incompatibilities.
    Author:
    Rene Schneider - initial API and implementation
    • Method Detail

      • getSetListEntryChildCount

        public static int getSetListEntryChildCount​(SetListEntry anEntry)
        Returns the number of children that a specified SetListEntry has. This includes only "children" to be displayed as child nodes in the tree.
        Parameters:
        anEntry - the entry
        Returns:
        the number of child nodes
      • getSetListEntryChildReferences

        public static java.util.List<java.lang.Integer> getSetListEntryChildReferences​(SetListEntry anEntry)
        Returns a list of child node references belonging to a specified SetListEntry. This only includes such children that should be displayed in the tree.
        Parameters:
        anEntry - the entry
        Returns:
        a list of child references (entry IDs), or null if this is not applicable.
      • getSetListEntryChild

        public static SetListEntry getSetListEntryChild​(SetListEntry anEntry,
                                                        SetList aSetList,
                                                        int aChildIndex)
        Returns the actual child entry at a specified position within the children of a specified SetListEntry.
        Parameters:
        anEntry - the entry
        aSetList - the setlist that the entry belongs to
        aChildIndex - the index of the child to get
        Returns:
        the child entry, or null if there is none
      • getSetListEntryChilds

        public static java.util.List<SetListEntry> getSetListEntryChilds​(SetListEntry anEntry,
                                                                         SetList aSetList)
        Returns the actual child entries of the given SetListEntry.
        Parameters:
        anEntry - the entry
        aSetList - the setlist that the entry belongs to
        Returns:
        the list of childs, or null if the entry does not refer to any childs due to its type