Class AIInOut.AIFileSegmentInOut

  • All Implemented Interfaces:
    AIInOut
    Enclosing interface:
    AIInOut

    public static class AIInOut.AIFileSegmentInOut
    extends Object
    implements AIInOut
    AIFileSegmentInOut is an implementation of AIInOut that reads from a segment of a segmented file.
    • Field Detail

      • segmentIndex

        protected final int segmentIndex
    • Constructor Detail

      • AIFileSegmentInOut

        public AIFileSegmentInOut​(SegmentedFile segmentedFile,
                                  int segmentIndex)
        Constructs an AIFileSegmentInOut instance.
        Parameters:
        segmentedFile - the segmented file to read from
        segmentIndex - the index of the segment to read
    • Method Detail

      • read

        public String read()
        Reads the segment from the segmented file and returns its content as a string.
        Specified by:
        read in interface AIInOut
        Returns:
        the segment content as a string
      • write

        public void write​(String content)
        Writes a string to the segment of the segmented file.
        Specified by:
        write in interface AIInOut
        Parameters:
        content - the string to write
      • getFile

        public File getFile()
        Description copied from interface: AIInOut
        The underlying file.
        Specified by:
        getFile in interface AIInOut