public class SortOption extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ASCENDING |
static String |
DESCENDING |
| Constructor and Description |
|---|
SortOption(int number,
String definition)
Construct a new SortOption object using the definition from the configuration
|
SortOption(int number,
String name,
String md,
String type)
Construct a new SortOption object with the given parameters
|
| Modifier and Type | Method and Description |
|---|---|
static SortOption |
getDefaultSortOption()
Get the default sort option - initially, just the first one defined.
|
String[] |
getMdBits() |
String |
getMetadata() |
String |
getName() |
int |
getNumber() |
static SortOption |
getSortOption(int number)
Get the defined sort option by number (.1, .2, etc).
|
static Set<SortOption> |
getSortOptions()
Return all the configured sort options.
|
String |
getType() |
String[] |
interpretField(String mfield,
String init)
Take a string representation of a metadata field, and return it as an array.
|
boolean |
isDate()
Is this a date field?
|
boolean |
isDefault()
Is the default sort option?
|
boolean |
isVisible()
Should this sort option be made visible in the UI
|
void |
setMetadata(String metadata) |
void |
setName(String name) |
void |
setNumber(int number) |
void |
setType(String type) |
public static final String ASCENDING
public static final String DESCENDING
public SortOption(int number,
String name,
String md,
String type)
throws SortException
number - name - md - type - SortExceptionpublic SortOption(int number,
String definition)
throws SortException
number - definition - SortExceptionpublic String getMetadata()
public void setMetadata(String metadata)
metadata - The metadata to set.public String getName()
public void setName(String name)
name - The name to set.public String getType()
public void setType(String type)
type - The type to set.public int getNumber()
public void setNumber(int number)
number - The number to set.public boolean isVisible()
public String[] getMdBits()
public final String[] interpretField(String mfield, String init) throws IOException
mfield - the string representation of the metadatainit - the default value of the array elementsIOExceptionpublic boolean isDate()
public boolean isDefault()
public static Set<SortOption> getSortOptions() throws SortException
SortExceptionpublic static SortOption getSortOption(int number) throws SortException
number - SortExceptionpublic static SortOption getDefaultSortOption() throws SortException
SortExceptionCopyright © 2014 DuraSpace. All Rights Reserved.