KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > MOTableModel


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - MOTableModel.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## Licensed under the Apache License, Version 2.0 (the "License");
8   _## you may not use this file except in compliance with the License.
9   _## You may obtain a copy of the License at
10   _##
11   _## http://www.apache.org/licenses/LICENSE-2.0
12   _##
13   _## Unless required by applicable law or agreed to in writing, software
14   _## distributed under the License is distributed on an "AS IS" BASIS,
15   _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   _## See the License for the specific language governing permissions and
17   _## limitations under the License.
18   _##
19   _##########################################################################*/

20
21
22 package org.snmp4j.agent.mo;
23
24 import org.snmp4j.smi.OID;
25 import java.util.Iterator JavaDoc;
26
27 /**
28  * The <code>MOTableModel</code> interface defines the base table
29  * model interface needed for <code>MOTable</code>s. This model can be used
30  * for read-only and read-write SNMP conceptual tables. For read-create tables
31  * the {@link MOMutableTableModel} should be used instead.
32  *
33  * @author Frank Fock
34  * @version 1.0
35  */

36 public interface MOTableModel {
37
38   /**
39    * Returns the number of columns currently in this table model.
40    * @return
41    * the number of columns.
42    */

43   int getColumnCount();
44
45   /**
46    * Returns the number of rows currently in this table model.
47    * @return
48    * the number of rows.
49    */

50   int getRowCount();
51
52   /**
53    * Checks whether this table model contains a row with the specified index.
54    * @param index
55    * the index OID of the row to search.
56    * @return
57    * <code>true</code> if this model has a row of with index
58    * <code>index</code> or <code>false</code> otherwise.
59    */

60   boolean containsRow(OID index);
61
62   /**
63    * Gets the row with the specified index.
64    * @param index
65    * the row index.
66    * @return
67    * the <code>MOTableRow</code> with the specified index and
68    * <code>null</code> if no such row exists.
69    */

70   MOTableRow getRow(OID index);
71
72   /**
73    * Returns an iterator over the rows in this table model.
74    * @return
75    * an <code>Iterator</code> returning <code>MOTableRow</code> instances.
76    */

77   Iterator JavaDoc iterator();
78
79   /**
80    * Returns an iterator on a view of the rows of this table model
81    * whose index values are greater or equal <code>lowerBound</code>.
82    *
83    * @param lowerBound
84    * the lower bound index (inclusive). If <code>lowerBound</code> is
85    * <code>null</code> the returned iterator is the same as returned by
86    * {@link #iterator}.
87    * @return
88    * an <code>Iterator</code> over the
89    */

90   Iterator JavaDoc tailIterator(OID lowerBound);
91
92   /**
93    * Returns the last row index in this model.
94    * @return
95    * the last index OID of this model.
96    */

97   OID lastIndex();
98
99   /**
100    * Returns the first row index in this model.
101    * @return
102    * the first index OID of this model.
103    */

104   OID firstIndex();
105
106   /**
107    * Returns the first row contained in this model.
108    * @return
109    * the <code>MOTableRow</code> with the smallest index or <code>null</code>
110    * if the model is empty.
111    */

112   MOTableRow firstRow();
113
114   /**
115    * Returns the last row contained in this model.
116    * @return
117    * the <code>MOTableRow</code> with the greatest index or <code>null</code>
118    * if the model is empty.
119    */

120   MOTableRow lastRow();
121 }
122
Popular Tags