⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datastructures.myinteger.html

📁 Data StructuresAnd Algorithm Analysis In Java Source Code
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Sep 27 09:53:39 EDT 1998
-->
<title>
Class DataStructures.MyInteger
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-DataStructures.html">This Package</a>  <a href="DataStructures.LinkedListItr.html">Previous</a>  <a href="DataStructures.PairHeap.html">Next</a>  <a href="Index.html">Index</a>  </pre>
<hr>
<h1>
Class DataStructures.MyInteger
</h1>
<pre>
java.lang.Object
    |
    +----DataStructures.MyInteger
</pre>
<hr>
<dl>
<dt>public final class <b>MyInteger</b>
<dt>extends Object<dt>implements <a href="DataStructures.Comparable.html">Comparable</a>, <a href="DataStructures.Hashable.html">Hashable</a></dl>
Wrapper class for use with generic data structures.Mimics Integer.In Java 1.2, you can use Integer if Comparable is needed.
<p>
<hr>
<a name="index"></a><h2>
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
<dt><img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#MyInteger()"><b>MyInteger</b></a>()
<dd>Construct the MyInteger object with initial value 0.
<dt><img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#MyInteger(int)"><b>MyInteger</b></a>(int)
<dd>Construct the MyInteger object.
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#compareTo(DataStructures.Comparable)"><b>compareTo</b></a>(Comparable)
<dd>Implements the compareTo method.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
<dd>Implements the equals method.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#hash(int)"><b>hash</b></a>(int)
<dd>Implements the hash method.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#intValue()"><b>intValue</b></a>()
<dd>Gets the stored int value.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#toString()"><b>toString</b></a>()
<dd>Implements the toString method.
</dl>
<a name="constructors"></a><h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="MyInteger"></a><a name="MyInteger"></a><a name="MyInteger()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>MyInteger</b>
<pre>
public MyInteger()</pre>
<dl>
<dd>Construct the MyInteger object with initial value 0.
<p>
</dl>
<a name="MyInteger"></a><a name="MyInteger(int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>MyInteger</b>
<pre>
public MyInteger(int x)</pre>
<dl>
<dd>Construct the MyInteger object.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the initial value.
</dl>
</dd>
</dl>
<a name="methods"></a><h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="intValue"></a><a name="intValue()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>intValue</b>
<pre>
public int intValue()</pre>
<dl>
<dd>Gets the stored int value.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the stored value.</dl>
</dd>
</dl>
<a name="toString"></a><a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>toString</b>
<pre>
public String toString()</pre>
<dl>
<dd>Implements the toString method.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the String representation.<dt><b>Overrides:</b>
<dd>toString in class Object</dl>
</dd>
</dl>
<a name="compareTo"></a><a name="compareTo(DataStructures.Comparable)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>compareTo</b>
<pre>
public int compareTo(<a href="DataStructures.Comparable.html">Comparable</a> rhs)</pre>
<dl>
<dd>Implements the compareTo method.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>rhs - the other MyInteger object.
<dt><b>Returns:</b>
<dd>0 if two objects are equal;less than zero if this object is smaller;greater than zero if this object is larger.<dt><b>Throws:</b>
ClassCastException<dd>if rhs is nota MyInteger.</dl>
</dd>
</dl>
<a name="equals"></a><a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>equals</b>
<pre>
public boolean equals(Object rhs)</pre>
<dl>
<dd>Implements the equals method.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>rhs - the second MyInteger.
<dt><b>Returns:</b>
<dd>true if the objects are equal, false otherwise.<dt><b>Throws:</b>
ClassCastException<dd>if rhs is nota MyInteger.<dt><b>Overrides:</b>
<dd>equals in class Object</dl>
</dd>
</dl>
<a name="hash"></a><a name="hash(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>hash</b>
<pre>
public int hash(int tableSize)</pre>
<dl>
<dd>Implements the hash method.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>tableSize - the hash table size.
<dt><b>Returns:</b>
<dd>a number between 0 and tableSize-1.</dl>
</dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-DataStructures.html">This Package</a>  <a href="DataStructures.LinkedListItr.html">Previous</a>  <a href="DataStructures.PairHeap.html">Next</a>  <a href="Index.html">Index</a>  </pre>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -