KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > commonj > sdo > Sequence


1 /**
2  * <copyright>
3  *
4  * Service Data Objects
5  * Version 1.0
6  * Licensed Materials - Property of BEA and IBM
7  *
8  * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2003. All rights reserved.
9  *
10  * </copyright>
11  *
12  * $Id: Sequence.java,v 1.1 2004/03/26 15:24:15 marcelop Exp $
13  */

14 package commonj.sdo;
15
16 /**
17  * A sequence is a heterogeneous list of {@link Property properties} and corresponding values.
18  * It represents an ordered arbitrary mixture of data values from more than one property of a {@link DataObject data object}.
19  */

20 public interface Sequence
21 {
22   /**
23    * Returns the number of entries in the sequence.
24    * @return the number of entries.
25    */

26   int size();
27
28   /**
29    * Returns the property for the given entry index.
30    * Returns <code>null</code> for mixed text entries.
31    * @param index the index of the entry.
32    * @return the property or <code>null</code> for the given entry index.
33    */

34   Property getProperty(int index);
35   
36   /**
37    * Returns the property value for the given entry index.
38    * @param index the index of the entry.
39    * @return the value for the given entry index..
40    */

41   Object JavaDoc getValue(int index);
42   
43   /**
44    * Sets the entry at a specified index to the new value.
45    * @param index the index of the entry.
46    * @param value the new value for the entry.
47    */

48   Object JavaDoc setValue(int index, Object JavaDoc value);
49
50   /**
51    * Adds a new entry with the specified property name and value
52    * to the end of the entries.
53    * @param propertyName the name of the entry's property.
54    * @param value the value for the entry.
55    */

56   boolean add(String JavaDoc propertyName, Object JavaDoc value);
57
58   /**
59    * Adds a new entry with the specified property index and value
60    * to the end of the entries.
61    * @param propertyIndex the index of the entry's property.
62    * @param value the value for the entry.
63    */

64   boolean add(int propertyIndex, Object JavaDoc value);
65
66   /**
67    * Adds a new entry with the specified property and value
68    * to the end of the entries.
69    * @param property the property of the entry.
70    * @param value the value for the entry.
71    */

72   boolean add(Property property, Object JavaDoc value);
73
74   /**
75    * Adds a new entry with the specified property name and value
76    * at the specified entry index.
77    * @param index the index at which to add the entry.
78    * @param propertyName the name of the entry's property.
79    * @param value the value for the entry.
80    */

81   void add(int index, String JavaDoc propertyName, Object JavaDoc value);
82
83   /**
84    * Adds a new entry with the specified property index and value
85    * at the specified entry index.
86    * @param index the index at which to add the entry.
87    * @param propertyIndex the index of the entry's property.
88    * @param value the value for the entry.
89    */

90   void add(int index, int propertyIndex, Object JavaDoc value);
91
92   /**
93    * Adds a new entry with the specified property and value
94    * at the specified entry index.
95    * @param index the index at which to add the entry.
96    * @param property the property of the entry.
97    * @param value the value for the entry.
98    */

99   void add(int index, Property property, Object JavaDoc value);
100  
101   /**
102    * Removes the entry at the given entry index.
103    * @param index the index of the entry
104    */

105   void remove(int index);
106
107   /**
108    * Moves the entry at <code>fromIndex</code> to <code>toIndex</code>.
109    * @param toIndex the index of the entry destination.
110    * @param fromIndex the index of the entry to move.
111    */

112   void move(int toIndex, int fromIndex);
113 }
114
Popular Tags