Class BySummaryOrder

  • All Implemented Interfaces:
    NodeParser, java.io.Serializable

    public class BySummaryOrder
    extends java.lang.Object
    implements java.io.Serializable, NodeParser
    BySummaryOrder saves the options for the sort by aggregate function.
    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BySummaryOrder()
      FOR INTERNAL USE ONLY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSummaryField​(SummaryField sField)
      Adds a summary field used for sorting.
      BySummaryOrder copy()
      Creates a copy of this.
      boolean equals​(java.lang.Object object)
      Compares the other object with this.
      int getN()
      Gets the count of displayed elements
      int getOther()
      Gets the type for handling the values with sorting number greater than n.
      java.lang.String getOtherName()
      Gets the display name the other group entry.
      int getSortDirection()
      Gets the direction of the sorting
      int getSortType()
      Gets the type of sorting
      SummaryField getSummaryField​(int index)
      Gets the summary field used for sorting at index position.
      int getSummaryFieldCount()
      Use this method to get the number of summary fields used for sorting.
      boolean isDOMParser()
      FOR INTERNAL USE ONLY Internal method for reading report XML
      java.lang.String paramString()
      Returns the String representation of this object.
      void parseDOM​(org.w3c.dom.Node node, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      NodeParser parseElement​(com.inet.report.parser.XMLTag xGroup, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void parseEndElement​(com.inet.report.parser.XMLTag xGroup, java.lang.String tag, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void parseText​(java.lang.String text, java.util.Map<java.lang.String,​java.lang.Object> parserMap)
      FOR INTERNAL USE ONLY Internal method for reading report XML
      void removeSummaryField​(int index)
      Removes the SummaryField from this sort order.
      void setN​(int n)
      Sets the count of displayed elements
      void setOther​(int otherType)
      Sets the type for handling the values with sorting number greater than n.
      void setOtherName​(java.lang.String otherName)
      Sets display name for the other group entry.
      void setSortDirection​(int direction)
      Sets the direction of sorting
      void setSortType​(int type)
      Sets the type of sorting
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_OTHER_NAME

        public static final java.lang.String DEFAULT_OTHER_NAME
        Default name for all other elements.
        See Also:
        Constant Field Values
      • GROUP_SORT_TOP_N_PERCENTAGE

        public static final int GROUP_SORT_TOP_N_PERCENTAGE
        Display only first n-procent elements in descending sort order
        See Also:
        setSortType(int), Constant Field Values
      • GROUP_SORT_BOTTOM_N_PERCENTAGE

        public static final int GROUP_SORT_BOTTOM_N_PERCENTAGE
        Display only first n-procent elements in ascending sort order
        See Also:
        setSortType(int), Constant Field Values
      • SORT_ASCENDING_ORDER

        public static final int SORT_ASCENDING_ORDER
        Constant for ascending order sort direction.
        See Also:
        Constant Field Values
      • SORT_DESCENDING_ORDER

        public static final int SORT_DESCENDING_ORDER
        Constant for descending order sort direction.
        See Also:
        Constant Field Values
      • OTHER_RECORDS_GROUP_TO_OTHERS

        public static final int OTHER_RECORDS_GROUP_TO_OTHERS
        All values with sorting number greater than n are group together to the group other.
        See Also:
        setOther(int), Constant Field Values
      • OTHER_RECORDS_DISCARD

        public static final int OTHER_RECORDS_DISCARD
        All values with sorting number greater than n are discard and not part of the report.
        See Also:
        setOther(int), Constant Field Values
    • Constructor Detail

      • BySummaryOrder

        public BySummaryOrder()
        FOR INTERNAL USE ONLY
    • Method Detail

      • getOtherName

        public java.lang.String getOtherName()
        Gets the display name the other group entry.
        Returns:
        the name for all other group values.
        Since:
        4.0
        See Also:
        setOtherName(String)
      • setN

        public void setN​(int n)
        Sets the count of displayed elements
        Parameters:
        n - count of shown group values.
        Throws:
        java.lang.IllegalArgumentException - if n less than 0.
        Since:
        4.0
      • getN

        public int getN()
        Gets the count of displayed elements
        Returns:
        count
        Since:
        4.0
      • setOtherName

        public void setOtherName​(java.lang.String otherName)
        Sets display name for the other group entry. This value has no effect if the sortType GROUP_SORT_ALL is set.
        Parameters:
        otherName - the new name.
        Throws:
        java.lang.IllegalArgumentException - if the name is empty or null.
        Since:
        4.0
        See Also:
        setOther(int), getOtherName()
      • getSummaryField

        public SummaryField getSummaryField​(int index)
        Gets the summary field used for sorting at index position.
        Parameters:
        index - of the summary field.
        Returns:
        the summary field at index.
        Throws:
        java.lang.IndexOutOfBoundsException - if this index is out of bounds of the summary fields list.
        Since:
        4.0
      • getSummaryFieldCount

        public int getSummaryFieldCount()
        Use this method to get the number of summary fields used for sorting.
        Returns:
        The number of summary fields used for sorting.
        Since:
        4.0
      • addSummaryField

        public void addSummaryField​(SummaryField sField)
        Adds a summary field used for sorting.
        Parameters:
        sField - SummaryField
        Throws:
        java.lang.IllegalArgumentException - if the SummaryField null is
        Since:
        4.0
      • removeSummaryField

        public void removeSummaryField​(int index)
        Removes the SummaryField from this sort order.
        Parameters:
        index - of removed field.
        Throws:
        java.lang.IndexOutOfBoundsException - if this index is out of bounds of the summary fields list or the list is null.
        Since:
        4.0
      • setSortDirection

        public void setSortDirection​(int direction)
        Sets the direction of sorting
        Parameters:
        direction - the sort direction of this sort order, asc. or desc.
        Since:
        4.0
        See Also:
        SORT_ASCENDING_ORDER, SORT_DESCENDING_ORDER
      • paramString

        public java.lang.String paramString()
        Returns the String representation of this object.
        Returns:
        the description as String.
        Since:
        6.0
      • equals

        public boolean equals​(java.lang.Object object)
        Compares the other object with this. Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - the other object
        Returns:
        true if this is equal to other object
        Since:
        8.0
      • parseElement

        public NodeParser parseElement​(com.inet.report.parser.XMLTag xGroup,
                                       java.lang.String tag,
                                       org.xml.sax.Attributes atts,
                                       java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                                throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.

        Specified by:
        parseElement in interface NodeParser
        Parameters:
        xGroup - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.
        tag - The XMLTag to be parsed
        atts - The set of attributes in the current XMLTag
        parserMap - The map of current Parser.
        Returns:
        The NodeParser sub-element if one needed to be created, or null if none was created.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • parseText

        public void parseText​(java.lang.String text,
                              java.util.Map<java.lang.String,​java.lang.Object> parserMap)
        FOR INTERNAL USE ONLY Internal method for reading report XML

        This method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)

        Specified by:
        parseText in interface NodeParser
        Parameters:
        text - text encountered and to be stored
        parserMap - The map of current Parser.
      • parseEndElement

        public void parseEndElement​(com.inet.report.parser.XMLTag xGroup,
                                    java.lang.String tag,
                                    java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                             throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Receive notification of the end of an XML tag.

        Specified by:
        parseEndElement in interface NodeParser
        Parameters:
        xGroup - XMLTag of the current node to be parsed, or null if there is no such current group.
        tag - The XMLTag to be parsed
        parserMap - The map of current Parser.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • isDOMParser

        public boolean isDOMParser()
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Returns whether this node is to be read via a DOM parser.

        Specified by:
        isDOMParser in interface NodeParser
        Returns:
        true if this node is to be read via a DOM parser, false otherwise.
      • parseDOM

        public void parseDOM​(org.w3c.dom.Node node,
                             java.util.Map<java.lang.String,​java.lang.Object> parserMap)
                      throws FatalParserException
        FOR INTERNAL USE ONLY Internal method for reading report XML

        Parses the node.

        Specified by:
        parseDOM in interface NodeParser
        Parameters:
        node - the node
        parserMap - The map of current Parser.
        Throws:
        FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
      • copy

        public BySummaryOrder copy()
        Creates a copy of this. The copy has then same group, renderer and sum fields.
        Returns:
        the copy
        Since:
        11.1