Package com.inet.report
Class SpecifiedOrder
java.lang.Object
com.inet.report.SpecifiedOrder
- All Implemented Interfaces:
NodeParser
,Serializable
This class saved the details of the specified sort order of groups. *
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
All not specified values are discard and not part of the report.static final int
All not specified values are group together to the group other.static final int
All not specified values are group in its own groups. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
add
(String name, FormulaField formula) Add a new group value at the end of the list.int
Add a new group value at the end of the list.boolean
Compares the other object with this.int
Find the index of a group with its name.final int
getCount()
Get the count of specified group values.getFormula
(int idx) Return the formula of the nth group.getFormulaField
(int idx) FOR INTERNAL USE ONLY Returns FormulaField from indexgetName
(int idx) Return the display name of the nth group.Get the display name the other group entry.int
Get the type for handling the not specified rows.boolean
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
move
(int idx, int offset) Move a group entry to another position in the list.void
Move a group entry to another position in the list.Create aString
representation of this sort order for debugging.void
FOR INTERNAL USE ONLY Internal method for reading report XMLparseElement
(com.inet.report.parser.XMLTag group, String tagName, Attributes atts, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseEndElement
(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
remove
(int idx) Remove a group entry from this list.void
Remove a group entry from this list.void
setFormula
(int idx, FormulaField formula) Set a new formula value on the idx position.void
Change the name of a group entry.void
setOtherName
(String otherName) Set display name for the other group entry.void
setOtherType
(int otherType) Set the type for handling the not specified rows.
-
Field Details
-
OTHER_RECORDS_GROUP_TO_OTHERS
public static final int OTHER_RECORDS_GROUP_TO_OTHERSAll not specified values are group together to the group other.- See Also:
-
OTHER_RECORDS_DISCARD
public static final int OTHER_RECORDS_DISCARDAll not specified values are discard and not part of the report.- See Also:
-
OTHER_RECORDS_LEAVE_IN_OWN_GROUP
public static final int OTHER_RECORDS_LEAVE_IN_OWN_GROUPAll not specified values are group in its own groups. The order of this groups is unspecified and can change in future versions.- See Also:
-
-
Constructor Details
-
SpecifiedOrder
public SpecifiedOrder()FOR INTERNAL USE ONLY
-
-
Method Details
-
getCount
public final int getCount()Get the count of specified group values.- Returns:
- the count of values.
- Since:
- 6.0
- See Also:
-
getName
Return the display name of the nth group.- Parameters:
idx
- index of group value.- Returns:
- the name of nth group value.
- Throws:
IllegalArgumentException
- if the index is out of range.- Since:
- 6.0
- See Also:
-
getFormula
Return the formula of the nth group. The return type of the formula must be BOOLEAN. The formula must return TRUE if a row is part of this group.- Parameters:
idx
- index of group value.- Returns:
- the formula of nth group value as
String
. - Throws:
IllegalArgumentException
- if the index is out of range.- Since:
- 6.0
- See Also:
-
getFormulaField
FOR INTERNAL USE ONLY Returns FormulaField from index- Parameters:
idx
- the index of formula- Returns:
- the formula field
- Since:
- 6.0
-
add
Add a new group value at the end of the list.- Parameters:
name
- the display name (null
not permitted).formula
- the filter for this group (null
not permitted).- Returns:
- the index of the new group entry.
- Throws:
IllegalArgumentException
- if the name already exists or name or formula are null- Since:
- 6.0
- See Also:
-
add
Add a new group value at the end of the list.- Parameters:
name
- the display name.formula
- the filter for this group.- Returns:
- the index of the new group entry.
- Throws:
ReportException
- formula parse failed.IllegalArgumentException
- if the name already exists.- Since:
- 6.0
- See Also:
-
findName
Find the index of a group with its name.- Parameters:
name
- the display name of the group.- Returns:
- returns the index or -1 if not found.
- Since:
- 6.0
-
remove
public void remove(int idx) Remove a group entry from this list.- Parameters:
idx
- the index start at position 0.- Throws:
IllegalArgumentException
- if the index is out of range.- Since:
- 6.0
- See Also:
-
remove
Remove a group entry from this list.- Parameters:
name
- the display name of the group.- Throws:
ReportException
- if the name was not found.- Since:
- 6.0
- See Also:
-
move
public void move(int idx, int offset) Move a group entry to another position in the list.- Parameters:
idx
- the position of the group entry. The index start at 0.offset
- the count of position that is moved. A value of 0 has no effect.- Throws:
IllegalArgumentException
- if the index is out of range.- Since:
- 6.0
-
move
Move a group entry to another position in the list.- Parameters:
name
- the name of the group entry.offset
- the count of position that is moved. A value of 0 has no effect.- Throws:
ReportException
- if the name was not found.- Since:
- 6.0
-
setFormula
Set a new formula value on the idx position.- Parameters:
idx
- the position start at index 0.formula
- the new formula string (null
not permitted).- Throws:
IllegalArgumentException
- if the index is out of range.- Since:
- 6.0
-
setName
Change the name of a group entry.- Parameters:
idx
- the index of the group entry starting at 0.name
- the new name of the group entry (null
not permitted).- Throws:
IllegalArgumentException
- if the name already exists or the index is out of range. or if the name already exists or the index is out of range.- Since:
- 6.0
-
getOtherName
Get the display name the other group entry.- Returns:
- the name for other group values.
- Since:
- 6.0
- See Also:
-
setOtherName
Set display name for the other group entry. This value has only an effect if the type OTHER_RECORDS_GROUP_TO_OTHERS is set.- Parameters:
otherName
- the new name.- Throws:
IllegalArgumentException
- if the name is empty or null.- Since:
- 6.0
- See Also:
-
getOtherType
public int getOtherType()Get the type for handling the not specified rows.- Returns:
- the type of handling.
- Since:
- 6.0
- See Also:
-
setOtherType
public void setOtherType(int otherType) Set the type for handling the not specified rows.- Parameters:
otherType
- the new value.- Since:
- 6.0
- See Also:
-
paramString
Create aString
representation of this sort order for debugging.- Returns:
- the representation.
- Since:
- 7.0
-
equals
Compares the other object with this. Indicates whether some other object is "equal to" this one. -
isDOMParser
public boolean isDOMParser()FOR INTERNAL USE ONLY Internal method for reading report XMLReturns whether this node is to be read via a DOM parser.
- Specified by:
isDOMParser
in interfaceNodeParser
- Returns:
- true if this node is to be read via a DOM parser, false otherwise.
-
parseDOM
FOR INTERNAL USE ONLY Internal method for reading report XMLParses the node.
- Specified by:
parseDOM
in interfaceNodeParser
- Parameters:
node
- the nodeparserMap
- 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.
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tagName, Attributes atts, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLParses 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 interfaceNodeParser
- Parameters:
group
- 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.tagName
- The XMLTag to be parsedatts
- The set of attributes in the current XMLTagparserMap
- 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.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Specified by:
parseEndElement
in interfaceNodeParser
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group.tag
- The XMLTag to be parsedparserMap
- 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.
-
parseText
FOR INTERNAL USE ONLY Internal method for reading report XMLThis 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 interfaceNodeParser
- Parameters:
text
- text encountered and to be storedparserMap
- The map of current Parser.
-