drasys.or.matrix.complex
Class SVFReader
java.lang.Object
|
+--java.io.Reader
|
+--java.io.BufferedReader
|
+--drasys.or.matrix.complex.SVFReader
- public class SVFReader
- extends java.io.BufferedReader
- implements VectorReaderI
Inputs complex vectors from an
SVF
stream.
Fields inherited from class java.io.Reader |
lock |
Method Summary |
int |
readVector(SizableVectorI vector,
boolean resize)
Reads a vector from the stream in the
SVF
format. |
int |
readVector(VectorI vector)
Reads a vector from the stream in the
SVF
format. |
void |
setIgnoreInvalid(boolean ignore)
If 'ignore' is 'true' then any elements with invalid indices will be ignored. |
Methods inherited from class java.io.BufferedReader |
close,
mark,
markSupported,
read,
read,
readLine,
ready,
reset,
skip |
Methods inherited from class java.io.Reader |
read |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
SVFReader
public SVFReader(java.io.Reader in)
SVFReader
public SVFReader(java.io.Reader in,
int sz)
setIgnoreInvalid
public void setIgnoreInvalid(boolean ignore)
- If 'ignore' is 'true' then any elements with invalid indices will be ignored.
If 'ignore' is 'false' then an InvalidArrayIndexException will be thrown for elements with invalid indices.
The default is to throw an exception for invalid elements.
- Specified by:
- setIgnoreInvalid in interface VectorReaderI
readVector
public int readVector(VectorI vector)
throws java.io.IOException
- Reads a vector from the stream in the
SVF
format.
Any elements in the vector not appearing in the input stream will remain unchanged.
The size record is used to make sure the input vector will fit in the container vector.
- Specified by:
- readVector in interface VectorReaderI
- Returns:
- the number of elements read from the stream.
- Throws:
- java.lang.ArrayIndexOutOfBoundsException - if the input vector size or
an element's index is invalid for the container vector size.
readVector
public int readVector(SizableVectorI vector,
boolean resize)
throws java.io.IOException
- Reads a vector from the stream in the
SVF
format.
Any elements in the vector not appearing in the input stream will remain unchanged.
The size record is used to set the size of the container vector if 'resize' is 'true'.
- Specified by:
- readVector in interface VectorReaderI
- Returns:
- the number of elements read from the stream.
- Throws:
- java.lang.ArrayIndexOutOfBoundsException - if the input vector size or
an element's index is invalid for the container vector size.
Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com