Go to the previous, next section.
#include <nihcl/Range.h>
Instances of class
Range
represent a range of integers, expressed as the lower bound, or first index, and the length. Ranges are particularly useful for describing substrings.
Range()
Range
with a first index of 0 and a length of -1. This is an invalid
Range
; that is, the member function
valid()
will return
NO
if applied to this
Range
.
Range(int
first, int
length)
Range
with a first index of
first
and a length of
length.
int firstIndex() const
int lastIndex() const
int length() const
Range
, respectively.
int firstIndex() const
int lastIndex() const
int length() const
int firstIndex(int
first)
int lastIndex(int
last)
int length(int
len)
Range
, respectively, and returns the new value.
virtual unsigned hash() const
bool operator==(const Range&) const
bool operator!=(const Range&) const
YES
if this
Range
is equal to (or not equal to) the right operand
Range
.
virtual bool isEqual(const Object&
ob) const
YES
if
ob
is of species
Range
and equals this
Range
.
bool valid() const
YES
if this
Range
is valid; that is, the length of this
Range
is >= 0.
void operator=(const Range&)
Range
to this
Range
.
virtual void deepenShallowCopy()
Range
.
virtual void printOn(ostream&
strm
=cout) const
Range
on
strm
in the format
first index:length
.
virtual const Class* species() const
Range
.
virtual void storer(OIOofd&
fd) const
virtual void storer(OIOout&
strm) const
Range
on
fd
or
strm.
virtual int compare(const Object&) const
shouldNotImplement()
.
Go to the previous, next section.