/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// java imports
//
// jmx imports
//
/**
* Represents a SNMP index.
* An <CODE>SnmpIndex</CODE> is represented as a <CODE>Vector</CODE> of <CODE>SnmpOid</CODE>.
* <P>
* This class is used internally and by the classes generated by <CODE>mibgen</CODE>.
* You should not need to use this class directly.
*
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
*/
/**
* Initializes an <CODE>SnmpIndex</CODE> using a vector of object identifiers.
* <P>Following the RFC recommendations, every syntax that is used as a
* table index should have an object identifier representation. There are
* some guidelines on how to map the different syntaxes into an object identifier.
* In the different <CODE>SnmpValue</CODE> classes provided, there is a <CODE>toOid</CODE> method to get
* the object identifier of the value.
*
* @param oidList The list of Object Identifiers.
*/
for(int i= 0; i <size; i++) {
// The order is important ...
//
}
}
/**
* Initializes an <CODE>SnmpIndex</CODE> using the specified Object Identifier.
*
* @param oid The Object Identifier.
*/
size= 1;
}
/**
* Gets the number of Object Identifiers the index is made of.
*
* @return The number of Object Identifiers.
*/
public int getNbComponents() {
return size;
}
/**
* Gets the index as a vector of Object Identifiers.
*
* @return The index as a vector.
*/
return oids;
}
/**
* Compares two indexes for equality.
*
* @param index The index to compare <CODE>this</CODE> with.
*
* @return <CODE>true</CODE> if the two indexes are equal, <CODE>false</CODE> otherwise.
*/
return false;
// The two vectors have the same length.
// Compare each single element ...
//
for(int i=0; i <size; i++) {
return false;
}
return true;
}
/**
* Compares two indexes.
*
* @param index The index to compare <CODE>this</CODE> with.
*
* @return The value 0 if the two OID vectors have the same elements, another value otherwise.
*/
int comp;
for(int i=0; i < size; i++) {
if ( i > length) {
// There is no more element in the index
//
return 1;
}
// Access the element ...
//
if (comp == 0)
continue;
return comp;
}
return 0;
}
/**
* Returns a <CODE>String</CODE> representation of the index.
* The different elements are separated by "//".
*
* @return A string representation of the index.
*/
}
}
// PRIVATE VARIABLES
//------------------
/**
* The list of OIDs.
* @serial
*/
/**
* The number of elements in the index.
* @serial
*/
}