FileDocCategorySizeDatePackage
OutputPort.javaAPI DocAndroid 5.1 API3103Thu Mar 12 22:22:30 GMT 2015android.filterfw.core

OutputPort

public class OutputPort extends FilterPort
hide

Fields Summary
protected InputPort
mTargetPort
protected InputPort
mBasePort
Constructors Summary
public OutputPort(Filter filter, String name)

        super(filter, name);
    
Methods Summary
public voidclear()

        if (mTargetPort != null) {
            mTargetPort.clear();
        }
    
public voidclose()

        super.close();
        if (mTargetPort != null && mTargetPort.isOpen()) {
            mTargetPort.close();
        }
    
public voidconnectTo(InputPort target)

        if (mTargetPort != null) {
            throw new RuntimeException(this + " already connected to " + mTargetPort + "!");
        }
        mTargetPort = target;
        mTargetPort.setSourcePort(this);
    
public booleanfilterMustClose()

        return !isOpen() && isBlocking();
    
public InputPortgetBasePort()

        return mBasePort;
    
public FiltergetTargetFilter()

        return mTargetPort == null ? null : mTargetPort.getFilter();
    
public InputPortgetTargetPort()

        return mTargetPort;
    
public booleanhasFrame()

        return mTargetPort == null ? false : mTargetPort.hasFrame();
    
public booleanisConnected()

        return mTargetPort != null;
    
public booleanisReady()

        return (isOpen() && mTargetPort.acceptsFrame()) || !isBlocking();
    
public voidopen()

        super.open();
        if (mTargetPort != null && !mTargetPort.isOpen()) {
            mTargetPort.open();
        }
    
public FramepullFrame()

        throw new RuntimeException("Cannot pull frame on " + this + "!");
    
public voidpushFrame(Frame frame)

        if (mTargetPort == null) {
            throw new RuntimeException(
                "Attempting to push frame on unconnected port: " + this + "!");
        }
        mTargetPort.pushFrame(frame);
    
public voidsetBasePort(InputPort basePort)

        mBasePort = basePort;
    
public voidsetFrame(Frame frame)

        assertPortIsOpen();
        if (mTargetPort == null) {
            throw new RuntimeException(
                "Attempting to set frame on unconnected port: " + this + "!");
        }
        mTargetPort.setFrame(frame);
    
public java.lang.StringtoString()

        return "output " + super.toString();