Class AbstractSvetovidReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SvetovidReader
    Direct Known Subclasses:
    DefaultSvetovidReader

    public abstract class AbstractSvetovidReader
    extends java.lang.Object
    implements SvetovidReader
    This class provides default implementations for the SvetovidReader interface. Standard behaviors of all methods are defined here. The developer need only subclass this abstract class and define the doReadLine() method.
    Author:
    Ivan Pribela
    See Also:
    SvetovidReader, doReadLine()
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this reader and releases any resources associated with the underlying source.
      protected abstract java.lang.String doReadLine()  
      java.lang.Throwable getLastException()
      Returns the exception raised in the last operation; if the operation was successful and no exception was raised, returns null.
      java.util.regex.Pattern getWhitespace()
      Returns the currently used pattern for recognizing whitespace.
      protected void handleAnyException​(java.lang.Throwable exception)  
      protected void handleFormatException​(SvetovidFormatException exception)  
      boolean hasMore()
      Checks whether this reader has data to be read.
      protected boolean isCharInNumber​(char ch)  
      protected boolean isCharWhitespace​(char ch)  
      protected boolean isCharWhitespaceOrSymbol​(char ch)  
      boolean isEmpty()
      Checks whether this reader has no more data to be read.
      boolean isThrowingExceptions()
      Returns the indicator whether this reader will throw exceptions on I/O operation errors or just return default values.
      protected java.util.List<java.lang.Object> nextArray()  
      protected char nextChar()  
      protected java.lang.Boolean nextLiteral()  
      protected java.lang.Number nextNumber()  
      protected java.util.Map.Entry<java.lang.String,​java.lang.Object> nextPair()  
      protected java.lang.String nextString()  
      protected void nextToken()  
      protected java.lang.Object nextValue()  
      protected boolean parseBool​(java.lang.String string)  
      protected char parseChar​(java.lang.String string)  
      java.lang.String readAll()
      Reads all remaining content and returns it as a string.
      java.lang.String[] readAllLines()
      Read all remaining lines and returns them as an array of strings.
      boolean readBool()
      Reads one token and converts it to a boolean value.
      boolean[] readBoolArray()
      Reads one line, separates it into tokens and converts them to boolean values.
      java.lang.Boolean[] readBoolArrayBoxed()
      Reads one line, separates it into tokens and converts them to boolean values.
      java.lang.Boolean readBoolBoxed()
      Reads one token and converts it to a boolean value.
      boolean[][] readBoolMatrix()
      Reads multiple lines and converts the data to a boolean matrix.
      java.lang.Boolean[][] readBoolMatrixBoxed()
      Reads multiple lines and converts the data to a boolean matrix.
      byte readByte()
      Reads one token and converts it to a byte value.
      byte[] readByteArray()
      Reads one line, separates it into tokens and converts them to byte values.
      java.lang.Byte[] readByteArrayBoxed()
      Reads one line, separates it into tokens and converts them to byte values.
      java.lang.Byte readByteBoxed()
      Reads one token and converts it to a byte value.
      byte[][] readByteMatrix()
      Reads multiple lines and converts the data to a byte matrix.
      java.lang.Byte[][] readByteMatrixBoxed()
      Reads multiple lines and converts the data to a byte matrix.
      char readChar()
      Reads one token and converts it to a character value.
      char[] readCharArray()
      Reads one line, separates it into tokens and converts them to character values.
      java.lang.Character[] readCharArrayBoxed()
      Reads one line, separates it into tokens and converts them to character values.
      java.lang.Character readCharBoxed()
      Reads one token and converts it to a character value.
      char[][] readCharMatrix()
      Reads multiple lines and converts the data to a character matrix.
      java.lang.Character[][] readCharMatrixBoxed()
      Reads multiple lines and converts the data to a character matrix.
      double readDouble()
      Reads one token and converts it to a double-precision floating-point value.
      double[] readDoubleArray()
      Reads one line, separates it into tokens and converts them to double-precision floating-point values.
      java.lang.Double[] readDoubleArrayBoxed()
      Reads one line, separates it into tokens and converts them to double-precision floating-point values.
      java.lang.Double readDoubleBoxed()
      Reads one token and converts it to a double-precision floating-point value.
      double[][] readDoubleMatrix()
      Reads multiple lines and converts the data to a double-precision floating-point matrix.
      java.lang.Double[][] readDoubleMatrixBoxed()
      Reads multiple lines and converts the data to a double-precision floating-point matrix.
      float readFloat()
      Reads one token and converts it to a floating-point value.
      float[] readFloatArray()
      Reads one line, separates it into tokens and converts them to floating-point values.
      java.lang.Float[] readFloatArrayBoxed()
      Reads one line, separates it into tokens and converts them to floating-point values.
      java.lang.Float readFloatBoxed()
      Reads one token and converts it to a floating-point value.
      float[][] readFloatMatrix()
      Reads multiple lines and converts the data to a floating-point matrix.
      java.lang.Float[][] readFloatMatrixBoxed()
      Reads multiple lines and converts the data to a floating-point matrix.
      int readInt()
      Reads one token and converts it to an integer value.
      int[] readIntArray()
      Reads one line, separates it into tokens and converts them to integer values.
      java.lang.Integer[] readIntArrayBoxed()
      Reads one line, separates it into tokens and converts them to integer values.
      java.lang.Integer readIntBoxed()
      Reads one token and converts it to an integer value.
      int[][] readIntMatrix()
      Reads multiple lines and converts the data to an integer matrix.
      java.lang.Integer[][] readIntMatrixBoxed()
      Reads multiple lines and converts the data to an integer matrix.
      java.lang.String readLine()
      Reads a line of text and returns it as a string.
      long readLong()
      Reads one token and converts it to a long integer value.
      long[] readLongArray()
      Reads one line, separates it into tokens and converts them to long integer values.
      java.lang.Long[] readLongArrayBoxed()
      Reads one line, separates it into tokens and converts them to long integer values.
      java.lang.Long readLongBoxed()
      Reads one token and converts it to a long integer value.
      long[][] readLongMatrix()
      Reads multiple lines and converts the data to a long integer matrix.
      java.lang.Long[][] readLongMatrixBoxed()
      Reads multiple lines and converts the data to a long integer matrix.
      protected java.util.Map<java.lang.String,​java.lang.Object> readNextObject()  
      java.lang.Object readObject()
      Reads a JSON (JavaScript Object Notation) formatted object.
      short readShort()
      Reads one token and converts it to a short integer value.
      short[] readShortArray()
      Reads one line, separates it into tokens and converts them to short integer values.
      java.lang.Short[] readShortArrayBoxed()
      Reads one line, separates it into tokens and converts them to short integer values.
      java.lang.Short readShortBoxed()
      Reads one token and converts it to a short integer value.
      short[][] readShortMatrix()
      Reads multiple lines and converts the data to a shot integer matrix.
      java.lang.Short[][] readShortMatrixBoxed()
      Reads multiple lines and converts the data to a shot integer matrix.
      java.lang.String readToken()
      Reads one token and returns it as a string value.
      java.lang.String[] readTokenArray()
      Reads one line, separates it into tokens and returns them as string values.
      java.lang.String[][] readTokenMatrix()
      Reads multiple lines and converts the data to a string matrix.
      protected void returnChar​(char ch)  
      void setThrowingExceptions​(boolean shouldThrow)
      Configures whether this reader should throw exceptions on I/O operation errors or just return default values.
      void setWhitespace​(java.util.regex.Pattern whitespace)
      Sets the pattern used to recognize whitespace.
      protected void wrapUpIOException​(java.io.IOException e)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait