Class PrincetonRandomAccessDictionaryFile

    • Field Detail

      • READ_ONLY

        public static final java.lang.String READ_ONLY
        Read-only file permission.
        See Also:
        Constant Field Values
      • READ_WRITE

        public static final java.lang.String READ_WRITE
        Read-write file permission.
        See Also:
        Constant Field Values
      • _file

        private java.io.RandomAccessFile _file
        The random-access file.
      • _permissions

        protected java.lang.String _permissions
        The file permissions to use when opening a file.
    • Constructor Detail

      • PrincetonRandomAccessDictionaryFile

        public PrincetonRandomAccessDictionaryFile()
      • PrincetonRandomAccessDictionaryFile

        public PrincetonRandomAccessDictionaryFile​(java.lang.String path,
                                                   POS pos,
                                                   DictionaryFileType fileType)
      • PrincetonRandomAccessDictionaryFile

        public PrincetonRandomAccessDictionaryFile​(java.lang.String path,
                                                   POS pos,
                                                   DictionaryFileType fileType,
                                                   java.lang.String permissions)
    • Method Detail

      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Description copied from interface: RandomAccessDictionaryFile
        Read a line from the file
        Throws:
        java.io.IOException
      • seek

        public void seek​(long pos)
                  throws java.io.IOException
        Description copied from interface: RandomAccessDictionaryFile
        Go to postion pos in the file.
        Throws:
        java.io.IOException
      • getFilePointer

        public long getFilePointer()
                            throws java.io.IOException
        Description copied from interface: RandomAccessDictionaryFile
        Get the current position of the file pointer.
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Description copied from interface: DictionaryFile
        Return true if the file is open
      • close

        public void close()
        Description copied from interface: DictionaryFile
        Close the file
      • length

        public long length()
                    throws java.io.IOException
        Description copied from interface: RandomAccessDictionaryFile
        Get the length, in bytes, of the file
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Description copied from interface: RandomAccessDictionaryFile
        Read a byte from the file
        Throws:
        java.io.IOException