01: package vicazh.hyperpool.stream;
02:
03: import java.io.*;
04: import java.util.*;
05:
06: /**
07: * The time selector
08: *
09: * @author Victor Zhigunov
10: * @version 0.4.0
11: */
12: public class TimeSelector extends ListSelector implements
13: TimeSelectorMBean {
14:
15: private int type;
16:
17: public int getType() {
18: return type;
19: }
20:
21: public void setType(int type) {
22: this .type = type;
23: }
24:
25: public OutputStream get(OutputStream outputstream)
26: throws IOException {
27: Stream stream = (Stream) super .get(outputstream);
28: stream.connection.getClient().outputstream = get(
29: stream.connection.getServer(),
30: getIndex(new Integer(Calendar.getInstance().get(type)
31: - (type == Calendar.DAY_OF_WEEK ? 1 : 0))));
32: return stream;
33: }
34:
35: }
|