Package Torello.HTML.NodeSearch
Class IteratorOutOfBoundsException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IndexOutOfBoundsException
-
- Torello.HTML.NodeSearch.IteratorOutOfBoundsException
-
- All Implemented Interfaces:
java.io.Serializable
public class IteratorOutOfBoundsException extends java.lang.IndexOutOfBoundsException
An exception thrown by theHNLI
&HNLIInclusive
iterators when, in the processes of modifying or reading the contents of the most recentIterator
-Match, a location is specified that's out of the bounds of theVector
itself.
Using this Exception:
The use of this exception differs slightly from that of theCursorException
, with the primary difference being that a failed cursor-operation resulting in an invalid-cursor is not identical to an "Out of Bounds" exception for that iterator (when theIterator
, itself, might not have even had a cursor set by the user!).- See Also:
HNLIInclusive
,HNLI
, Serialized Form
Hi-Lited Source-Code:- View Here: Torello/HTML/NodeSearch/IteratorOutOfBoundsException.java
- Open New Browser-Tab: Torello/HTML/NodeSearch/IteratorOutOfBoundsException.java
File Size: 7,140 Bytes Line Count: 147 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description IteratorOutOfBoundsException()
Constructs anIteratorOutOfBoundsException
with no detail message.IteratorOutOfBoundsException(String message)
Constructs anIteratorOutOfBoundsException
with the specified detail message.
-
Method Summary
'static'
Exception Check MethodsModifier and Type Method static void
check(Vector<?> v, int pos)
static void
check(Vector<?> v, int[] posArr)
static void
check(Vector<?> v, DotPair dp)
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Note that Java'sjava.lang.Exception
andjava.lang.Error
classes implement theSerializable interface
, and a warning-free build expects this field be defined here.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final long serialVersionUID = 1;
-
-
Constructor Detail
-
IteratorOutOfBoundsException
public IteratorOutOfBoundsException()
Constructs anIteratorOutOfBoundsException
with no detail message.
-
IteratorOutOfBoundsException
public IteratorOutOfBoundsException(java.lang.String message)
Constructs anIteratorOutOfBoundsException
with the specified detail message.- Parameters:
message
- the detail message.
-
-
Method Detail
-
check
public static void check(java.util.Vector<?> v, int pos)
This method provides a consistently formatted error message when this exception is thrown by theHNLI
&HNLIInclusive
Iterator
classes. Mostly, like standardVector
operations, if theint 'pos'
parameter that was passed is negative or past the end of theVector
, anIndexOutOfBoundsException
will be thrown.- Parameters:
v
- This is usually passed a reference to the internalRaw-Type Vector
used by anHNLI
&HNLIInclusive
Iterator
class.
NOTE: The symbols<?>
appended to the (almost) 'raw-type' here, are only there to prevent the java-compiler from issuing warnings regarding the use of "Raw Types." This warning is, actually, only issued if the command-line option-Xlint:all
option is used.pos
- This is the position that has been attempted to index thatVector
.- Throws:
IteratorOutOfBoundsException
- This will throw if the value passed to parameter'pos'
is negative, or greater than the size of theVector
parameter'v'
.- See Also:
HNLI
,HNLIInclusive
- Code:
- Exact Method Body:
if (pos < 0) throw new IteratorOutOfBoundsException( "An attempt was made to reference the internal-state vector with a negative " + "index-value: [" + pos + "]" ); if (pos >= v.size()) throw new IteratorOutOfBoundsException( "An attempt was made to reference the internal-state vector with an index that " + "is past the end of the Vector. The attempted operation was made using " + "index [" + pos + "], but the internal-state vector has " + "vector.size() [" + v.size() + "]." );
-
check
public static void check(java.util.Vector<?> v, DotPair dp)
This method provides a consistently formatted error message for this exception. This is used by theHNLI
&HNLIInclusive
Iterator
classes. Mostly, like standardVector
operations, if theDotPair 'dp'
provided is not consistent with the dimensions of the input html-Vector
, then anIndexOutOfBoundsException
will be thrown.- Parameters:
v
- This is usually passed a reference to the internalRaw-Type Vector
used by anHNLI
&HNLIInclusive
Iterator
class.
NOTE: The symbols<?>
appended to the (almost) 'raw-type' here, are only there to prevent the java-compiler from issuing warnings regarding the use of "Raw Types." This warning is, actually, only issued if the command-line option-Xlint:all
option is used.dp
- This is the sub-section, or sub-list of theVector
that is being checked.- Throws:
IteratorOutOfBoundsException
- This will throw if the value passed to parameter'dp'
is negative, or greater than the size ofVector
parameter'v'
.- See Also:
HNLI
,HNLIInclusive
- Code:
- Exact Method Body:
if (dp.end >= v.size()) throw new IteratorOutOfBoundsException( "An attempt was made to reference the internal-state vector with an index that " + "is past the end of the Vector. The attempted operation was made using " + "DotPair " + dp.toString() + ", but the internal-state vector has " + "vector.size() [" + v.size() + "]." );
-
check
public static void check(java.util.Vector<?> v, int[] posArr)
This method provides a consistently formatted error message when this exception is thrown by theHNLI
&HNLIInclusive
Iterator
classes. Mostly, like standardVector
operations, if any of the index-positions that are referenced by theint[] posArr
parameter are negative or past the end of theVector
, anIndexOutOfBoundsException
will be thrown.- Parameters:
v
- This is usually passed a reference to the internalRaw-Type Vector
used by anHNLI
&HNLIInclusive
Iterator
class.
NOTE: The symbols<?>
appended to the (almost) 'raw-type' here, are only there to prevent the java-compiler from issuing warnings regarding the use of "Raw Types." This warning is, actually, only issued if the command-line option-Xlint:all
option is used.posArr
- This is thearray
of position-indices intoVector
parameter'v'
that have been requested to update or for replacement.
IMPORTANT: In the code that invokes this method, theint[]
position-array
passed to parameter'posArr'
will ALWAYS have been sorted before being received here. As such, only the first and last elements of this array are actually check for validity. If thisarray
is not sorted, then the check performed by this method will be thoroughly insufficient.- Throws:
IteratorOutOfBoundsException
- This will throw if any of the the values passed to parameter'posArr'
are negative, or greater than the size ofVector
parameter'v'
.- See Also:
HNLI
,HNLIInclusive
- Code:
- Exact Method Body:
if (posArr[0] < 0) throw new IteratorOutOfBoundsException( "An attempt was made to reference the internal-state vector with a " + "negative index-value. The smallest (most-negative) value " + "passed to the vector-index integer-array was [" + posArr[0] + "]." ); if (posArr[posArr.length-1] >= v.size()) throw new IteratorOutOfBoundsException( "An attempt was made to reference the internal-state vector with a " + "location that is past the end of the Vector. The largest value passed to " + "the vector-index integer-array was [" + posArr[posArr.length-1] + "]. " + "The internal-state vector has vector.size() [" + v.size() + "]." );
-
-