FileDocCategorySizeDatePackage
StreamPort.javaAPI DocAndroid 5.1 API2535Thu Mar 12 22:22:30 GMT 2015android.filterfw.core

StreamPort

public class StreamPort extends InputPort
hide

Fields Summary
private Frame
mFrame
private boolean
mPersistent
Constructors Summary
public StreamPort(Filter filter, String name)

        super(filter, name);
    
Methods Summary
protected synchronized voidassignFrame(Frame frame, boolean persistent)

        assertPortIsOpen();
        checkFrameType(frame, persistent);

        if (persistent) {
            if (mFrame != null) {
                mFrame.release();
            }
        } else if (mFrame != null) {
            throw new RuntimeException(
                "Attempting to push more than one frame on port: " + this + "!");
        }
        mFrame = frame.retain();
        mFrame.markReadOnly();
        mPersistent = persistent;
    
public voidclear()

        if (mFrame != null) {
            mFrame.release();
            mFrame = null;
        }
    
public synchronized booleanhasFrame()

        return mFrame != null;
    
public synchronized FramepullFrame()

        // Make sure we have a frame
        if (mFrame == null) {
            throw new RuntimeException("No frame available to pull on port: " + this + "!");
        }

        // Return a retained result
        Frame result = mFrame;
        if (mPersistent) {
            mFrame.retain();
        } else {
            mFrame = null;
        }
        return result;
    
public voidpushFrame(Frame frame)

        assignFrame(frame, false);
    
public voidsetFrame(Frame frame)

        assignFrame(frame, true);
    
public java.lang.StringtoString()

        return "input " + super.toString();
    
public synchronized voidtransfer(FilterContext context)

        if (mFrame != null) {
            checkFrameManager(mFrame, context);
        }