01: /*
02: * Copyright (c) 2001 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.lib.aSocket.nbio;
26:
27: import seda.nbio.*;
28: import seda.sandStorm.api.*;
29: import seda.sandStorm.lib.aSocket.*;
30:
31: /**
32: * A SelectQueueElement is a wrapper for SelectItem which makes it a
33: * QueueElementIF.
34: *
35: * @author Matt Welsh
36: */
37: public class SelectQueueElement extends
38: seda.sandStorm.lib.aSocket.SelectQueueElement {
39:
40: public SelectItem item;
41:
42: public SelectQueueElement(SelectItem item) {
43: this .item = item;
44: }
45:
46: public Object getItem() {
47: return item;
48: }
49:
50: public Object getAttachment() {
51: if (item != null)
52: return item.obj;
53: else
54: return null;
55: }
56:
57: public void clearEvents() {
58: if (item != null)
59: item.revents = 0;
60: }
61: }
|