java.lang.Object
org.jpo.datamodel.NodeStatistics
A Class that counts nodes, groups, pictures and disk usage on the supplied
node
-
Constructor Summary
ConstructorDescriptionNodeStatistics
(@NotNull DefaultMutableTreeNode nodeToAnalyse) Constructs a NodeStatistics Object for the supplied node -
Method Summary
Modifier and TypeMethodDescriptionstatic int
countNodes
(@NotNull TreeNode start) Recursive static method that loops through the child nodes to find the number of nodes.static int
countPictures
(DefaultMutableTreeNode startNode, boolean recurseSubgroups) Returns the number of PictureInfo Nodes in a subtree.static int
countPicturesRecursively
(DefaultMutableTreeNode startNode) Returns the number of PictureInfo nodes in a subtree recursing through the Groups.getNode()
Returns the node being analysed.int
Returns the number of groups in the supplied node.Returns a multilingual label with the number of Groupsint
Returns the number of nodes including the root node in the treeReturns the number of nodes with the multilingual label in front of the number.int
Returns the number of Pictures found in the supplied node.Returns the number of Pictures found in the supplied node prefixed with the multilingual labellong
Returns the bytes of the pictures underneath the supplied nodeReturns the bytes of the pictures underneath the supplied node as a Stringfinal void
setNode
(DefaultMutableTreeNode nodeToAnalyse) Sets the node to be analysed
-
Constructor Details
-
NodeStatistics
Constructs a NodeStatistics Object for the supplied node- Parameters:
nodeToAnalyse
- The node for which to perform the analysis
-
-
Method Details
-
setNode
Sets the node to be analysed- Parameters:
nodeToAnalyse
- the nodes
-
getNode
Returns the node being analysed.- Returns:
- the node being analysed
-
getNumberOfNodes
public int getNumberOfNodes()Returns the number of nodes including the root node in the tree- Returns:
- The number of nodes including the root node
-
countNodes
Recursive static method that loops through the child nodes to find the number of nodes. Returns 0 if the node is null.- Parameters:
start
- The node on which to start- Returns:
- The number of nodes including the root node or 0 if null is supplied.
-
getNumberOfNodesString
Returns the number of nodes with the multilingual label in front of the number.- Returns:
- Returns the number of nodes with the multilingual label in front of the number
-
getNumberOfGroups
public int getNumberOfGroups()Returns the number of groups in the supplied node.- Returns:
- Returns the number of groups in the supplied node.
-
getNumberOfGroupsString
Returns a multilingual label with the number of Groups- Returns:
- Returns a multilingual label with the number of Groups
-
getNumberOfPictures
public int getNumberOfPictures()Returns the number of Pictures found in the supplied node.- Returns:
- Returns the number of Pictures found in the supplied node.
-
getNumberOfPicturesString
Returns the number of Pictures found in the supplied node prefixed with the multilingual label- Returns:
- Returns the number of Pictures found in the supplied node prefixed with the multilingual label
-
countPicturesRecursively
Returns the number of PictureInfo nodes in a subtree recursing through the Groups.- Parameters:
startNode
- The Start node- Returns:
- The number of PictureInfo nodes
-
countPictures
Returns the number of PictureInfo Nodes in a subtree. Useful for progress monitors. If called with a null start node it returns 0. If called with a node that is actually a Query object it asks the Query for the count.- Parameters:
startNode
- the node from which to countrecurseSubgroups
- indicator to say whether the next levels of groups should be counted too or not.- Returns:
- the number of PictureInfo nodes
-
getSizeOfPictures
public long getSizeOfPictures()Returns the bytes of the pictures underneath the supplied node- Returns:
- Returns the bytes of the pictures underneath the supplied node
-
getSizeOfPicturesString
Returns the bytes of the pictures underneath the supplied node as a String- Returns:
- Returns the bytes of the pictures underneath the supplied node
-