blob: c3619758ce6b62365514d526bf8c5c26be54bb2d [file] [log] [blame]
{ "type": "class",
"qname": "org.apache.royale.collections.SortField",
"baseClassname": "org.apache.royale.events.EventDispatcher"
,
"description": "Provides the sorting information required to establish a sort on a field or property in a collection view. The SortField class is meant to be used with the Sort class. Typically the sort is defined for collections of complex items, that is items in which the sort is performed on properties of those objects. As in the following example: <pre><code>\\n var col:ICollectionView = new ArrayListView();\\n col.addItem({first:&quot;Anders&quot;, last:&quot;Dickerson&quot;});\\n var sort:Sort = new Sort();\\n sort.fields = [new SortField(&quot;first&quot;, true)];\\n col.sort = sort;\\n </code></pre> There are situations in which the collection contains simple items, like <code>String</code>, <code>Date</code>, <code>Boolean</code>, etc. In this case, sorting should be applied to the simple type directly. When constructing a sort for this situation only a single sort field is required and should not have a <code>name</code> specified. For example: <pre><code>\\n var col:ICollectionView = new ArrayListView();\\n col.addItem(&quot;California&quot;);\\n col.addItem(&quot;Arizona&quot;);\\n var sort:Sort = new Sort();\\n sort.fields = [new SortField(null, true)];\\n col.sort = sort;\\n </code></pre> <p>By default the comparison provided by the SortField class does not provide correct language specific sorting for strings. For this type of sorting please see the <code>spark.collections.Sort</code> and <code>spark.collections.SortField</code> classes.</p> Note: to prevent problems like <a href=&quot;https://issues.apache.org/jira/browse/FLEX-34853&quot;>FLEX-34853</a> it is recommended to use SortField instances as immutable objects (by not changing their state). <p>The <code>&lt;mx:SortField&gt;</code> tag has the following attributes:</p> <pre>\\n &lt;mx:SortField\\n <b>Properties</b>\\n caseInsensitive=&quot;false&quot;\\n compareFunction=&quot;<em>Internal compare function</em>&quot;\\n descending=&quot;false&quot;\\n name=&quot;null&quot;\\n numeric=&quot;null&quot;\\n /&gt;\\n </pre>",
"tags": [
{ "tagName": "see",
"values": ["mx.collections.ICollectionView", "mx.collections.Sort", "spark.collections.Sort", "spark.collections.SortField"]},
{ "tagName": "mxml",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "method",
"qname": "org.apache.royale.collections.SortField",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor. comparison. If the object is a simple type, pass <code>null</code>. whether to ignore the case of the values. descending order. numbers, instead of alphabetically. default compare functions to use. objects based on this SortField.",
"tags": [
{ "tagName": "param",
"values": ["name The name of the property that this field uses for", "caseInsensitive When sorting strings, tells the comparator", "descending Tells the comparator whether to arrange items in", "numeric Tells the comparator whether to compare sort items as", "sortCompareType Gives an indication to SortField which of the", "customCompareFunction Use a custom function to compare the"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": [{ "name": "name", "type": "String"},
{ "name": "caseInsensitive", "type": "Boolean"},
{ "name": "descending", "type": "Boolean"},
{ "name": "numeric", "type": "Object"},
{ "name": "sortCompareType", "type": "String"},
{ "name": "customCompareFunction", "type": "Function"}]}
,
{ "type": "accessor",
"access": "read-only",
"return": "int",
"qname": "arraySortOnOptions",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Function",
"qname": "compareFunction",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The function that compares two items during a sort of items for the associated collection. If you specify a <code>compareFunction</code> property in an <code>ISort</code> object, Flex ignores any <code>compareFunction</code> properties of the ISort's <code>SortField</code> objects. <p>The compare function must have the following signature:</p> <p><code>function myCompare(a:Object, b:Object):int</code></p> <p>This function must return the following values:</p> <ul> <li>-1, if the <code>Object a</code> should appear before the <code>Object b</code> in the sorted sequence</li> <li>0, if the <code>Object a</code> equals the <code>Object b</code></li> <li>1, if the <code>Object a</code> should appear after the <code>Object b</code> in the sorted sequence</li> </ul> <p>The default value is an internal compare function that can perform a string, numeric, or date comparison in ascending or descending order, with case-sensitive or case-insensitive string comparisons. Specify your own function only if you need a need a custom comparison algorithm. This is normally only the case if a calculated field is used in a display.</p> Note if you need language-specific sorting then consider using the <code>spark.collections.SortField</code> class.",
"tags": [
{ "tagName": "see",
"values": ["spark.collections.SortField"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Boolean",
"qname": "descending",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "String",
"qname": "name",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Object",
"qname": "numeric",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "String",
"qname": "sortCompareType",
"namespace": "public",
"bindable": ["sortCompareTypeChanged"],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 11.8", "AIR 3.8"]},
{ "tagName": "productversion",
"values": ["Flex 4.11"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Boolean",
"qname": "usingCustomCompareFunction",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "initializeDefaultCompareFunction",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "obj", "type": "Object"}]}
,
{ "type": "method",
"qname": "reverse",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "updateSortCompareType",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "inheritDoc",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 11.8", "AIR 3.8"]},
{ "tagName": "productversion",
"values": ["Flex 4.11"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Boolean",
"params": []}
,
{ "type": "method",
"qname": "objectHasSortField",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"return": "Boolean",
"params": [{ "name": "object", "type": "Object"}]}
,
{ "type": "method",
"qname": "getSortFieldValue",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"return": "*",
"params": [{ "name": "obj", "type": "Object"}]}
,
{ "type": "method",
"qname": "stringCompare",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Pull the strings from the objects and call the implementation.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "int",
"params": [{ "name": "a", "type": "Object"},
{ "name": "b", "type": "Object"}]}
,
{ "type": "method",
"qname": "xmlCompare",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Pull the values out fo the XML object, then compare using the string or numeric comparator depending on the numeric flag.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "int",
"params": [{ "name": "a", "type": "Object"},
{ "name": "b", "type": "Object"}]}
]
}