YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.browser.BrowseSorter Class Reference

The client-side sort of a fully loaded folder (issue #252), kept free of the adapter so it can run on a worker thread: it never touches the list it is given, it returns a sorted copy. More...

Collaboration diagram for de.yaacc.browser.BrowseSorter:
Collaboration graph

Classes

class  Result
 The sorted copy and what changed against the input.
 

Static Public Member Functions

static List< DIDLObject > complete (List<? extends DIDLObject > loaded, org.fourthline.cling.support.model.DIDLContent rest, BrowseContentItemAdapter.SortMode mode, boolean nameAscending, boolean dateAscending)
 The folder as the screen shows it when it is complete: what the screen has loaded, then the rest that came from the server (containers first, then items; an object that is in both counts once), sorted like the screen sorts a complete folder.
 
static Result sort (List<? extends DIDLObject > input, BrowseContentItemAdapter.SortMode mode, boolean nameAscending, boolean dateAscending)
 
static boolean hasDate (DIDLObject object)
 

Detailed Description

The client-side sort of a fully loaded folder (issue #252), kept free of the adapter so it can run on a worker thread: it never touches the list it is given, it returns a sorted copy.

No Android classes.

The orderings are the former comparators of BrowseContentItemAdapter, unchanged:

  • NAME: containers before items regardless of direction, titles compared ignoring case (a missing title counts as empty), the comparison reverses with the direction.
  • DATE: containers and items interleaved by dc:date; a missing or unparseable date sorts last in either direction.

Both sorts are stable, like List#sort.

Member Function Documentation

◆ complete()

static List< DIDLObject > de.yaacc.browser.BrowseSorter.complete ( List<? extends DIDLObject > loaded,
org.fourthline.cling.support.model.DIDLContent rest,
BrowseContentItemAdapter.SortMode mode,
boolean nameAscending,
boolean dateAscending )
static

The folder as the screen shows it when it is complete: what the screen has loaded, then the rest that came from the server (containers first, then items; an object that is in both counts once), sorted like the screen sorts a complete folder.

This is the list that "play all" queues, so that it is the whole folder and in the order that the screen has.


The documentation for this class was generated from the following file: