KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > lists > Sequence


1 // Copyright (c) 2001, 2003 Per M.A. Bothner and Brainfood Inc.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.lists;
5
6 /**
7  * A Sequence is an ordered list of elements.
8  * It is similar to and compatible with the Java2 java.util.List interface,
9  * but does not require it.
10  *
11  * All standard classes that implement Sequence also extend AbstractSequence.
12  * Using AbstractSequence provides default implementations for many methods,
13  * and also makes things a bit more efficient. However, client code should
14  * use Sequence rather than AbstractSequence.
15  *
16  * @author Per Bothner
17  */

18
19 public interface Sequence
20 extends
21     /* #ifdef JAVA2 */
22     java.util.List JavaDoc,
23     /* #endif */
24     Consumable
25 {
26   /** Special magic end-of-file marker. */
27   public static final Object JavaDoc eofValue = EofClass.eofValue;
28
29   /** True is this sequence contains no elements. */
30   public boolean isEmpty();
31
32   /** See java.util.List. */
33   public int size();
34
35   /** See java.util.List. */
36   public Object JavaDoc get (int index);
37
38   /** See java.util.List. */
39   public Object JavaDoc set (int index, Object JavaDoc value);
40
41   public void fill(Object JavaDoc value);
42
43   public java.util.Enumeration JavaDoc elements();
44
45   /** Return code used to indicate a position is at end of the sequence. */
46   public static final int EOF_VALUE = 0;
47   public static final int PRIM_VALUE = 16;
48   public static final int INT_U8_VALUE = PRIM_VALUE + 1;
49   public static final int INT_S8_VALUE = PRIM_VALUE + 2;
50   public static final int INT_U16_VALUE = PRIM_VALUE + 3;
51   public static final int INT_S16_VALUE = PRIM_VALUE + 4;
52   public static final int INT_U32_VALUE = PRIM_VALUE + 5;
53   public static final int INT_S32_VALUE = PRIM_VALUE + 6;
54   public static final int INT_U64_VALUE = PRIM_VALUE + 7;
55   public static final int INT_S64_VALUE = PRIM_VALUE + 8;
56
57   /** Return code used to indicate next element is 32-bit float. */
58   public static final int FLOAT_VALUE = PRIM_VALUE + 9;
59
60   /** Return code used to indicate next element is 64-bit double. */
61   public static final int DOUBLE_VALUE = PRIM_VALUE + 10;
62   public static final int BOOLEAN_VALUE = PRIM_VALUE + 11;
63   /** A byte in an encoded string.
64    * Part of a char, in contrast with INT_S8_VALUE, which is an integer. */

65   public static final int TEXT_BYTE_VALUE = PRIM_VALUE + 12;
66   public static final int CHAR_VALUE = PRIM_VALUE + 13;
67   public static final int CDATA_VALUE = 31;
68   public static final int OBJECT_VALUE = 32;
69   public static final int GROUP_VALUE = 33;
70   public static final int DOCUMENT_VALUE = 34;
71   public static final int ATTRIBUTE_VALUE = 35;
72   public static final int COMMENT_VALUE = 36;
73   public static final int PROCESSING_INSTRUCTION_VALUE = 37;
74   /*
75   public static final int NAMESPACE_ATTRIBUTE_VALUE = 16;
76   public static final int ENTITY_REFERENCE_VALUE = 16;
77   */

78 }
79
Popular Tags