i-net Clear Reports

com.inet.report
Class SpecifiedOrder

java.lang.Object
  extended by com.inet.report.SpecifiedOrder
All Implemented Interfaces:
NodeParser, java.io.Serializable

public class SpecifiedOrder
extends java.lang.Object
implements java.io.Serializable, NodeParser

This class saved the details of the specified sort order of groups. *

See Also:
Serialized Form

Field Summary
static int OTHER_RECORDS_DISCARD
          All not specified values are discard and not part of the report.
static int OTHER_RECORDS_GROUP_TO_OTHERS
          All not specified values are group together to the group other.
static int OTHER_RECORDS_LEAVE_IN_OWN_GROUP
          All not specified values are group in its own groups.
 
Method Summary
 int add(java.lang.String name, FormulaField formula)
          Add a new group value at the end of the list.
 int add(java.lang.String name, java.lang.String formula)
          Add a new group value at the end of the list.
 boolean equals(java.lang.Object object)
          Compares the other object with this.
 int findName(java.lang.String name)
          Find the index of a group with its name.
 int getCount()
          Get the count of specified group values.
 java.lang.String getFormula(int idx)
          Return the formula of the nth group.
 java.lang.String getName(int idx)
          Return the display name of the nth group.
 java.lang.String getOtherName()
          Get the display name the other group entry.
 int getOtherType()
          Get the type for handling the not specified rows.
 void move(int idx, int offset)
          Move a group entry to another position in the list.
 void move(java.lang.String name, int offset)
          Move a group entry to another position in the list.
 java.lang.String paramString()
          Create a String representation of this sort order for debugging.
 void remove(int idx)
          Remove a group entry from this list.
 void remove(java.lang.String name)
          Remove a group entry from this list.
 void setFormula(int idx, FormulaField formula)
          Set a new formula value on the idx position.
 void setName(int idx, java.lang.String name)
          Change the name of a group entry.
 void setOtherName(java.lang.String otherName)
          Set display name for the other group entry.
 void setOtherType(int otherType)
          Set the type for handling the not specified rows.
 
Methods inherited from interface com.inet.report.parser.NodeParser
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
 

Field Detail

OTHER_RECORDS_GROUP_TO_OTHERS

public static final int OTHER_RECORDS_GROUP_TO_OTHERS
All not specified values are group together to the group other.

See Also:
setOtherType(int), Constant Field Values

OTHER_RECORDS_DISCARD

public static final int OTHER_RECORDS_DISCARD
All not specified values are discard and not part of the report.

See Also:
setOtherType(int), Constant Field Values

OTHER_RECORDS_LEAVE_IN_OWN_GROUP

public static final int OTHER_RECORDS_LEAVE_IN_OWN_GROUP
All not specified values are group in its own groups. The order of this groups is unspecified and can change in future versions.

See Also:
setOtherType(int), Constant Field Values
Method Detail

getCount

public final int getCount()
Get the count of specified group values.

Returns:
the count of values.
See Also:
add(String, FormulaField), add(String, String), getName(int), getFormulaField(int)

getName

public java.lang.String getName(int idx)
Return the display name of the nth group.

Parameters:
idx - index of group value.
Returns:
the name of nth group value.
Throws:
java.lang.IllegalArgumentException - if the index is out of range.
See Also:
add(String, FormulaField), add(String, String), getCount(), getFormulaField(int)

getFormula

public java.lang.String getFormula(int idx)
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:
java.lang.IllegalArgumentException - if the index is out of range.
See Also:
Field.BOOLEAN, setFormula(int, FormulaField), getCount()

add

public int add(java.lang.String name,
               FormulaField formula)
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:
java.lang.IllegalArgumentException - if the name already exists or name or formula are null
See Also:
remove(int), move(int, int)

add

public int add(java.lang.String name,
               java.lang.String formula)
        throws ReportException
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.
java.lang.IllegalArgumentException - if the name allready exists.
See Also:
remove(int), move(int, int)

findName

public int findName(java.lang.String name)
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.

remove

public void remove(int idx)
Remove a group entry from this list.

Parameters:
idx - the index start at position 0.
Throws:
java.lang.IllegalArgumentException - if the index is out of range.
See Also:
add(String, String), remove(String), move(int, int)

remove

public void remove(java.lang.String name)
            throws ReportException
Remove a group entry from this list.

Parameters:
name - the display name of the group.
Throws:
ReportException - if the name was not found.
See Also:
add(String, String), remove(int)

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:
java.lang.IllegalArgumentException - if the index is out of range.

move

public void move(java.lang.String name,
                 int offset)
          throws ReportException
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.

setFormula

public void setFormula(int idx,
                       FormulaField formula)
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:
java.lang.IllegalArgumentException - if the index is out of range.

setName

public void setName(int idx,
                    java.lang.String name)
Change the name of a group entry.

Parameters:
idx - the index of the group enty starting at 0.
name - the new name of the group entry (null not permitted).
Throws:
java.lang.IllegalArgumentException - if the name allready exists or the index is out of range. or if the name allready exists or the index is out of range.

getOtherName

public java.lang.String getOtherName()
Get the display name the other group entry.

Returns:
the name for other group values.
See Also:
setOtherName(String)

setOtherName

public void setOtherName(java.lang.String otherName)
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:
java.lang.IllegalArgumentException - if the name is empty or null.
See Also:
setOtherType(int), getOtherName()

getOtherType

public int getOtherType()
Get the type for handling the not specified rows.

Returns:
the type of handling.
See Also:
setOtherType(int)

setOtherType

public void setOtherType(int otherType)
Set the type for handling the not specified rows.

Parameters:
otherType - the new value.
See Also:
setOtherName(String), getOtherType(), OTHER_RECORDS_GROUP_TO_OTHERS, OTHER_RECORDS_DISCARD, OTHER_RECORDS_LEAVE_IN_OWN_GROUP

paramString

public java.lang.String paramString()
Create a String representation of this sort order for debugging.

Returns:
the representation.

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

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH