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&HNLIInclusiveiterators 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 theVectoritself.
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 longserialVersionUID
-
Constructor Summary
Constructors Constructor IteratorOutOfBoundsException()IteratorOutOfBoundsException(String message)
-
Method Summary
'static'Exception Check MethodsModifier and Type Method static voidcheck(Vector<?> v, int pos)static voidcheck(Vector<?> v, int[] posArr)static voidcheck(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 theSerializableImplementation 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.Exceptionandjava.lang.Errorclasses 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 anIteratorOutOfBoundsExceptionwith no detail message.
-
IteratorOutOfBoundsException
public IteratorOutOfBoundsException(java.lang.String message)
Constructs anIteratorOutOfBoundsExceptionwith 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&HNLIInclusiveIteratorclasses. Mostly, like standardVectoroperations, if theint 'pos'parameter that was passed is negative or past the end of theVector, anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
v- This is usually passed a reference to the internalRaw-Type Vectorused by anHNLI&HNLIInclusiveIteratorclass.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:alloption 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 theVectorparameter'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&HNLIInclusiveIteratorclasses. Mostly, like standardVectoroperations, if theDotPair 'dp'provided is not consistent with the dimensions of the input html-Vector, then anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
v- This is usually passed a reference to the internalRaw-Type Vectorused by anHNLI&HNLIInclusiveIteratorclass.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:alloption is used.dp- This is the sub-section, or sub-list of theVectorthat is being checked.- Throws:
IteratorOutOfBoundsException- This will throw if the value passed to parameter'dp'is negative, or greater than the size ofVectorparameter'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&HNLIInclusiveIteratorclasses. Mostly, like standardVectoroperations, if any of the index-positions that are referenced by theint[] posArrparameter are negative or past the end of theVector, anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
v- This is usually passed a reference to the internalRaw-Type Vectorused by anHNLI&HNLIInclusiveIteratorclass.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:alloption is used.posArr- This is thearrayof position-indices intoVectorparameter'v'that have been requested to update or for replacement.
IMPORTANT: In the code that invokes this method, theint[]position-arraypassed 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 thisarrayis 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 ofVectorparameter'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() + "]." );
-
-