01: /*
02: * @(#)Indexed.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.lang;
10:
11: /**
12: * Index-access to an instance of this interface is interpreted as the set/get
13: * method call, which are defined in the implementation class.
14: *
15: * <pre>
16: *
17: * indexed[idx] ==> indexed.get(idx)
18: * indexed[idx] = value ==> indexed.set(idx, value)
19: *
20: * </pre>
21: */
22: public interface Indexed {
23:
24: /**
25: * Write access to the index
26: *
27: * @param idx
28: * the index
29: * @param value
30: * the object to be assigned
31: */
32: public void set(int idx, Object value);
33:
34: /**
35: * Read access to the index
36: *
37: * @param idx
38: * the index
39: */
40: public Object get(int idx);
41: }
|