r1196 - trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage
Author: glandais Date: 2008-02-22 16:48:39 +0000 (Fri, 22 Feb 2008) New Revision: 1196 Added: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortColumn.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortOrder.java Log: Enums for sorting Added: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortColumn.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortColumn.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortColumn.java 2008-02-22 16:48:39 UTC (rev 1196) @@ -0,0 +1,60 @@ +package fr.cemagref.simexplorer.is.storage; + +import org.apache.lucene.search.SortField; + +import fr.cemagref.simexplorer.is.storage.database.DatabaseConstants; + +/** + * The Enum SortColumn. + */ +public enum SortColumn { + /** None. */ + None("", 0), + /** The Date. */ + uuid(DatabaseConstants.KEY_UUID, SortField.STRING), + /** The Date. */ + version(DatabaseConstants.KEY_VERSION, SortField.STRING), + /** The Date. */ + name(DatabaseConstants.KEY_NAME, SortField.STRING), + /** The Date. */ + description(DatabaseConstants.KEY_DESCRIPTION, SortField.STRING), + /** The Date. */ + creationDate(DatabaseConstants.KEY_CREATIONDATE, SortField.LONG), + /** The Date. */ + elementClass(DatabaseConstants.KEY_CLASSNAME, SortField.STRING); + + /** The column. */ + private String column; + + /** The type. */ + private int type; + + /** + * Gets the column. + * + * @return the column + */ + public String getColumn() { + return column; + } + + /** + * Gets the type. + * + * @return the type + */ + public int getType() { + return type; + } + + /** + * Instantiates a new sort column. + * + * @param column the column + * @param type the type + */ + private SortColumn(String column, int type) { + this.column = column; + this.type = type; + } +} \ No newline at end of file Added: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortOrder.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortOrder.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/SortOrder.java 2008-02-22 16:48:39 UTC (rev 1196) @@ -0,0 +1,13 @@ +package fr.cemagref.simexplorer.is.storage; + +/** + * The Enum SortOrder. + */ +public enum SortOrder { + + /** The Ascending. */ + Ascending, + + /** The Descending. */ + Descending; +} \ No newline at end of file
participants (1)
-
glandais@users.labs.libre-entreprise.org