001package org.unix4j.io; 002 003import org.unix4j.line.Line; 004import org.unix4j.processor.LineProcessor; 005 006/** 007 * Represents a line-by-line output device. This interface does not add any 008 * functionality but refines the documentation for the generally defined methods 009 * from {@link LineProcessor}. 010 */ 011public interface Output extends LineProcessor { 012 /** 013 * Writes a line to the output. 014 * 015 * @param line 016 * the line to write to the output. 017 * 018 * @return true if this {@code Output} device is ready to process more 019 * lines, and false otherwise; output devices usually return true 020 */ 021 @Override 022 boolean processLine(Line line); 023 024 /** 025 * Indicates that all output has been written. Usually triggers a flush 026 * operation or closes the underlying reader or stream. 027 */ 028 @Override 029 void finish(); 030}