MicroStrategy ONE

CountInfo

The CountInfo interface is used to retrieve count-related information about a monitoring information request. CountInfo objects represent the count classified by the fields that were specified on the CountSettings interface on the MonitorSource before retrieving the results. Each CountInfo object has a count, a field name, a field value, and, optionally, a set of child CountInfo objects.

The CountInfo represents the count of objects that have a single value of the given field. For example, if the user specified in the CountSettings to do the count by project name, then by login name, then in the CountSummary collection, there would be one CountInfo object for each project name in the monitor results, whose count would be the number of items in that project. Under each of those CountInfo objects, would be another collection of CountInfo objects that would give the count of objects in that project for each username. Those username-related CountInfo objects would have no children, and thus would be the lowest-level count that is returned.

If the CountInfo object has a parent, then this count refers only to objects with the condition of the parent as well as the condition of the current object.

For an example of how to use CountSummary and CountInfo, refer to the first use case, Obtaining a Count of Jobs.

The following methods are exposed on the CountInfo interface:

  • getField()

    Returns the field that this count is grouped by.  

  • getValue()

    Returns the value for the current field that this count grouping represents  

  • getCount()

    Returns the count of items at this level.  

  • hasChildren()

    Returns whether there are child CountInfo objects or not.  

  • size()

    Returns the number of child CountInfo objects.  

  • get()

    Returns the CountInfo child with the given index.

  • getParent()

    Returns the parent CountInfo, if one exists. If there is no parent CountInfo, meaning it is a top-level grouping, this will return null. The purpose of this method is to be able to know what parent groupings have already occurred to obtain this count.

  • getUniqueCount()

    Returns the count of unique items at this level. If this is not meaningfully different from getCount, then the result of getCount will be returned.