Package com.inductiveautomation.rm.base
Class RMTopNSort
java.lang.Object
com.inductiveautomation.rm.base.RMSort
com.inductiveautomation.rm.base.RMTopNSort
- All Implemented Interfaces:
Archivable
,RMJSONArchiver.GetKeys
,Cloneable
,Comparator
This is a sort subclass to support sorting objects by their relative position in an array of values.
-
Field Summary
Fields inherited from class com.inductiveautomation.rm.base.RMSort
COMPARATOR, ORDER_ASCEND, ORDER_DESCEND, ORDER_INDETERMINATE, ORDER_SAME
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new value sort.RMTopNSort
(String aKey, int anOrder, int aCount, boolean includeOthers) Creates a new value sort. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.int
getCount()
Returns the count.boolean
Returns whether to include others.boolean
getPad()
Returns whether to pad to top N value.void
setCount
(int aCount) Sets the count.void
setIncludeOthers
(boolean includeOthers) Sets whether to include others.void
setPad
(boolean aValue) Sets whether to pad to top N value.toString()
Returns a string representation of top n sort.toXML
(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.base.RMSort
clone, compare, Compare, getJSONKeys, getKey, getOrder, getOrderDefault, getOrderString, setKey, setOrder, setOrderString, sort, sort, sort, sort, sort, sortedList, sortedList, sortedList, toggleOrder
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
RMTopNSort
public RMTopNSort()Creates a new value sort. -
RMTopNSort
Creates a new value sort.
-
-
Method Details
-
getCount
public int getCount()Returns the count. -
setCount
public void setCount(int aCount) Sets the count. -
getIncludeOthers
public boolean getIncludeOthers()Returns whether to include others. -
setIncludeOthers
public void setIncludeOthers(boolean includeOthers) Sets whether to include others. -
getPad
public boolean getPad()Returns whether to pad to top N value. -
setPad
public void setPad(boolean aValue) Sets whether to pad to top N value. -
equals
Standard equals implementation.- Specified by:
equals
in interfaceComparator
- Overrides:
equals
in classRMSort
-
toXML
XML archival.- Specified by:
toXML
in interfaceArchivable
- Overrides:
toXML
in classRMSort
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
- Overrides:
fromXML
in classRMSort
-
toString
Returns a string representation of top n sort.
-