Go to the previous, next section.
#include <nihcl/Integer.h>
Class
Integer
provides an NIH Class Library object to hold an integer number. This is useful, for example, if one wishes to associate a key object with an integer and store it in a
Dictionary
. Arithmetic operations on
Integer
objects have not been provided to discourage their use, due to their relative inefficiency.
Integer(long
value
=0)
Integer
with the value
value.
Integer(istream&
strm)
Integer
with the value read from the input stream
strm
with
istream::operator>>()
.
long value() const
Integer
.
long value(long
newValue)
Integer
to
newValue
and returns
newValue.
virtual unsigned hash() const
virtual int compare(const Object&
ob) const
Integer
with the argument object
ob, which must also be an instance of class
Integer
. Returns a negative result if this
Integer
is less than
ob, zero if this
Integer
equals
ob, and a positive result if this
Integer
is greater than
ob.
virtual bool isEqual(const Object&
ob) const
YES
if
ob
is of species
Integer
and equals this
Integer
.
virtual void deepenShallowCopy()
Integer
.
virtual void printOn(ostream&
strm
=cout) const
Integer
on output stream
strm
using
ostream::operator<<()
.
virtual void scanFrom(istream&
strm)
Integer
to the value obtained by reading the input stream
strm
with
istream::operator>>()
.
virtual const Class* species() const
Integer
.
virtual void storer(OIOofd&
fd) const
virtual void storer(OIOout&
strm) const
Integer
on
fd
or
strm.
Go to the previous, next section.