com.crystaldecisions.sdk.occa.report.data
Class TopNSort

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Sort
      extended by com.crystaldecisions.sdk.occa.report.data.TopNSort
All Implemented Interfaces:
ISort, ITopNSort, IClone

public class TopNSort
extends Sort
implements ITopNSort, IClone

This object implements a Top N sort order. If a group contains a summary, it is possible for the group to be Top N sorted. This sorts the groups according to the group summary that was inserted. Data is grouped according to the group name for the first N groups. The groups that are not included in the Top N are either discarded or grouped under a specified name. When possible, use the ITopNSort interface to manipulate this object.


Constructor Summary
TopNSort()
           
TopNSort(ITopNSort src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
           For internal use only.
 void endElement(java.lang.String eleName, java.util.Map objState)
           For internal use only.
 void enumerateMembers(IMemberVisitor visitor)
           
 TopNConditionFormulas getConditionFormulas()
           Returns the conditional formulas that override the sort values for the default Top N sort order.
 boolean getDiscardOthers()
           Returns what should be done with records that do not fall into the Top N group.
 int getNIndividualGroups()
           Returns the number of groups that should be in the Top N.
 java.lang.String getNotInTopBottomName()
           Returns the name used to group records that are not a part of the Top N group.
 double getPercentageValue()
           Returns the percentage of top or bottom values.
 boolean getWithTies()
           Returns whether ties are included when sorting top or bottom groups.
 boolean hasContent(java.lang.Object srcTopNSort)
           
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
           For internal use only.
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
           For internal use only.
 void save(XMLWriter writer, XMLSerializationContext ctxt)
           For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
           For internal use only.
 void setConditionFormulas(TopNConditionFormulas formulas)
           Sets the condition formulas that override the sort values for the default Top N sort order.
 void setDiscardOthers(boolean discardOthers)
           Sets what should be done with records that do not fall into the Top N group.
 void setNIndividualGroups(int nIndividualGroups)
           Sets the number of groups that should be in the Top N.
 void setNotInTopBottomName(java.lang.String notInTopBottomName)
           Sets the name used to group records that are not a part of the Top N group.
 void setPercentageValue(double percentageValue)
           
 void setWithTies(boolean withTies)
           Sets whether ties are included when sorting top or bottom groups.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
           For internal use only.
 
Methods inherited from class com.crystaldecisions.sdk.occa.report.data.Sort
doControllerModification, getControllableMixin, getDirection, getSortField, isDirectlyControllable, setDirection, setSortField
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.crystaldecisions.sdk.occa.report.data.ISort
getDirection, getSortField, setDirection, setSortField
 

Constructor Detail

TopNSort

public TopNSort(ITopNSort src)

TopNSort

public TopNSort()
Method Detail

clone

public java.lang.Object clone(boolean deepClone)
Overrides:
clone in class Sort

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)
Overrides:
copyTo in class Sort

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)
Description copied from class: Sort

For internal use only.

Overrides:
createMember in class Sort

endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)
Description copied from class: Sort

For internal use only.

Overrides:
endElement in class Sort

getDiscardOthers

public boolean getDiscardOthers()
Description copied from interface: ITopNSort

Returns what should be done with records that do not fall into the Top N group. If this value is true, records that are not a part of the Top N are discarded. If this is false, the records that are not in the Top N are grouped under the name specified in setNotInTopBottomName method.

Specified by:
getDiscardOthers in interface ITopNSort
Returns:
true if records that are not part of the Top N are discarded, and false otherwise.

getNIndividualGroups

public int getNIndividualGroups()
Description copied from interface: ITopNSort

Returns the number of groups that should be in the Top N.

Specified by:
getNIndividualGroups in interface ITopNSort
Returns:
An int that specifies the number of groups that should be in the Top N.

getPercentageValue

public double getPercentageValue()
Description copied from interface: ITopNSort

Returns the percentage of top or bottom values.

Specified by:
getPercentageValue in interface ITopNSort
Returns:
An double that specifies the percentage of top or bottom values.

getNotInTopBottomName

public java.lang.String getNotInTopBottomName()
Description copied from interface: ITopNSort

Returns the name used to group records that are not a part of the Top N group. This property is used only when the ITopNSort.getDiscardOthers() method returns false.

Specified by:
getNotInTopBottomName in interface ITopNSort
Returns:
A String containing the name used to group records that are not a part of the Top N group.

hasContent

public boolean hasContent(java.lang.Object srcTopNSort)
Overrides:
hasContent in class Sort

readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)
Description copied from class: Sort

For internal use only.

Overrides:
readElement in class Sort

save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Description copied from class: Sort

For internal use only.

Overrides:
save in class Sort
Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
Description copied from class: Sort

For internal use only.

Overrides:
save in class Sort
Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException
Description copied from class: Sort

For internal use only.

Overrides:
saveContents in class Sort
Throws:
java.io.IOException

setDiscardOthers

public void setDiscardOthers(boolean discardOthers)
Description copied from interface: ITopNSort

Sets what should be done with records that do not fall into the Top N group. If this value is true, records that are not a part of the Top N are discarded. If this is false, the records that are not in the Top N are grouped under the name specified in setNotInTopBottomName method.

Specified by:
setDiscardOthers in interface ITopNSort
Parameters:
discardOthers - true if records that are not part of the Top N are discarded, and false otherwise.

setNIndividualGroups

public void setNIndividualGroups(int nIndividualGroups)
Description copied from interface: ITopNSort

Sets the number of groups that should be in the Top N.

Specified by:
setNIndividualGroups in interface ITopNSort
Parameters:
nIndividualGroups - An int that specifies the number of groups that should be in the Top N.

setPercentageValue

public void setPercentageValue(double percentageValue)
Specified by:
setPercentageValue in interface ITopNSort

setNotInTopBottomName

public void setNotInTopBottomName(java.lang.String notInTopBottomName)
Description copied from interface: ITopNSort

Sets the name used to group records that are not a part of the Top N group. This property is used only when the ITopNSort.getDiscardOthers() method returns false.

Specified by:
setNotInTopBottomName in interface ITopNSort
Parameters:
notInTopBottomName - A String containing the name used to group records that are not a part of the Top N group.

startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)
Description copied from class: Sort

For internal use only.

Overrides:
startElement in class Sort

getConditionFormulas

public TopNConditionFormulas getConditionFormulas()
Description copied from interface: ITopNSort

Returns the conditional formulas that override the sort values for the default Top N sort order.

Specified by:
getConditionFormulas in interface ITopNSort
Returns:
A TopNConditionFormulas object containing the condition formulas that override the sort values for the default Top N sort order.

setConditionFormulas

public void setConditionFormulas(TopNConditionFormulas formulas)
Description copied from interface: ITopNSort

Sets the condition formulas that override the sort values for the default Top N sort order.

Specified by:
setConditionFormulas in interface ITopNSort
Parameters:
formulas - A TopNConditionFormulas object containing the condition formulas that override the sort values for the default Top N sort order.

getWithTies

public boolean getWithTies()
Description copied from interface: ITopNSort

Returns whether ties are included when sorting top or bottom groups. If this value is true, groups whose summarized values are equal will be accommodated.

Specified by:
getWithTies in interface ITopNSort
Returns:
true if ties are included when sorting top or bottom groups, and false otherwise.

setWithTies

public void setWithTies(boolean withTies)
Description copied from interface: ITopNSort

Sets whether ties are included when sorting top or bottom groups. If this value is true, groups whose summarized values are equal will be accommodated.

Specified by:
setWithTies in interface ITopNSort
Parameters:
withTies - true if ties are included when sorting top or bottom groups, and false otherwise.

enumerateMembers

public void enumerateMembers(IMemberVisitor visitor)
Overrides:
enumerateMembers in class Sort