KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > containers > ContainerSorterInterface


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
//
14
//
15
//
16
//
17

18
19 package org.jahia.data.containers;
20
21 import java.util.BitSet JavaDoc;
22 import java.util.Vector JavaDoc;
23
24 import org.jahia.services.version.EntryLoadRequest;
25
26
27 /**
28  * Jahia Standard Containers Sort Handler.
29  *
30  * @see ContainerSorterBean
31  * @see JahiaContainerSet
32  * @author Khue Nguyen <a HREF="mailto:khue@jahia.org">khue@jahia.org</a>
33  */

34
35 public interface ContainerSorterInterface {
36     
37     public abstract int getCtnListID();
38
39     public abstract void setCtnListID(int id);
40
41     //--------------------------------------------------------------------------
42
/**
43      * Do the sort. Optionally, you can provide a BitSet where each bit set correspond the a container id you want in the result.
44      * If you want all containers in the result, give a null BitSet.
45      *
46      * @param BitSet bits
47      */

48
49     public abstract Vector JavaDoc doSort(BitSet JavaDoc bits);
50
51     //--------------------------------------------------------------------------
52
/**
53      * Return the vector of sorted ctnids.
54      *
55      */

56     public abstract Vector JavaDoc result();
57
58     //--------------------------------------------------------------------------
59
/**
60      * Return the order , true - > ASC, false -> DESC.
61      *
62      */

63     public abstract boolean isAscOrdering();
64
65     //--------------------------------------------------------------------------
66
/**
67      * Return true, if the values are converted to number before sorting.
68      *
69      */

70     public abstract boolean isNumberOrdering();
71
72     //--------------------------------------------------------------------------
73
/**
74      * Force or not value to be converted to number before doing the sort.
75      *
76      */

77     public abstract boolean setNumberOrdering(boolean val);
78
79     //--------------------------------------------------------------------------
80
/**
81      * Set DESC ordering.
82      *
83      */

84     public abstract void setDescOrdering();
85
86     //--------------------------------------------------------------------------
87
/**
88      * Set ASC ordering.
89      *
90      */

91     public abstract boolean setAscOrdering();
92
93     //--------------------------------------------------------------------------
94
/**
95      * Set ASC ordering.
96      *
97      */

98     public abstract boolean setAscOrdering(boolean val);
99
100     //--------------------------------------------------------------------------
101
/**
102      * Return the sorting field.
103      *
104      * @return int ctnListID, the container list id.
105      */

106     public abstract String JavaDoc getSortingFieldName();
107
108     //--------------------------------------------------------------------------
109
/**
110      * Return the last sorting time.
111      *
112      * @return long , the last sorting time
113      */

114     public abstract long getLastSortingTime();
115
116     //--------------------------------------------------------------------------
117
/**
118      * Return true if the sorter initialited properly
119      *
120      * @return boolean, the valid state value.
121      */

122     public abstract boolean isValid();
123
124     //--------------------------------------------------------------------------
125
/**
126      * Return the update status. Each time the doSort method is called, this update status is set to true.
127      *
128      * @return boolean, the internal updated status value.
129      */

130     public abstract boolean getUpdateStatus();
131
132     //--------------------------------------------------------------------------
133
/**
134      * Set the update status to true.
135      *
136      */

137     public abstract void setUpdateStatus();
138
139     //--------------------------------------------------------------------------
140
public abstract EntryLoadRequest getEntryLoadRequest();
141
142     //--------------------------------------------------------------------------
143
/**
144      * You can reset the internal update status by setting it to false
145      *
146      */

147     public abstract void resetUpdateStatus();
148
149 }
150
Popular Tags