wt.folder
Class FolderCollationKeyFactory

java.lang.Object
  extended bywt.util.CollationKeyFactory
      extended bywt.folder.FolderCollationKeyFactory

public final class FolderCollationKeyFactory
extends CollationKeyFactory

A collation key factory for Foldered objects in a folder. This class provides a collation string which can be used to order a set of FolderEntry's, belonging to different folders, for display purposes. Also see wt.util.SortedEnumeration, which can be used to perform sorting.

Supported API: true
Extendable: false


Field Summary
 
Fields inherited from class wt.util.CollationKeyFactory
 
Constructor Summary
FolderCollationKeyFactory()
          Construct a collation key factory for the current WTContext's locale.
FolderCollationKeyFactory(Locale locale)
          Construct a collation key factory for the given locale.
 
Method Summary
 String getCollationString(Object obj)
          Get a collation string for the given object.
 
Methods inherited from class wt.util.CollationKeyFactory
getKey, getLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderCollationKeyFactory

public FolderCollationKeyFactory()
Construct a collation key factory for the current WTContext's locale.

Supported API: true
Extendable: false


FolderCollationKeyFactory

public FolderCollationKeyFactory(Locale locale)
Construct a collation key factory for the given locale.

Parameters:
locale - desired locale

Supported API: true
Extendable: false
Method Detail

getCollationString

public String getCollationString(Object obj)
Get a collation string for the given object. Prepends a 1 to the getName value for folders and a 2 for foldered objects. This sorts the folders to the top of the list. If it can't get a "getName" on the object then it will try to use the identity.

Overrides:
getCollationString in class CollationKeyFactory
Parameters:
obj - the object that will be part of the sorted results

Supported API: true
Extendable: false
Returns:
string collation key source string