FileDocCategorySizeDatePackage
FilterPort.javaAPI DocAndroid 5.1 API3524Thu Mar 12 22:22:30 GMT 2015android.filterfw.core

FilterPort

public abstract class FilterPort extends Object
hide

Fields Summary
protected android.filterfw.core.Filter
mFilter
protected String
mName
protected android.filterfw.core.FrameFormat
mPortFormat
protected boolean
mIsBlocking
protected boolean
mIsOpen
protected boolean
mChecksType
private boolean
mLogVerbose
private static final String
TAG
Constructors Summary
public FilterPort(android.filterfw.core.Filter filter, String name)


         
        mName = name;
        mFilter = filter;
        mLogVerbose = Log.isLoggable(TAG, Log.VERBOSE);
    
Methods Summary
protected voidassertPortIsOpen()

        if (!isOpen()) {
            throw new RuntimeException("Illegal operation on closed " + this + "!");
        }
    
protected voidcheckFrameManager(Frame frame, FilterContext context)

        if (frame.getFrameManager() != null
            && frame.getFrameManager() != context.getFrameManager()) {
            throw new RuntimeException("Frame " + frame + " is managed by foreign FrameManager! ");
        }
    
protected voidcheckFrameType(Frame frame, boolean forceCheck)

        if ((mChecksType || forceCheck)
            && mPortFormat != null
            && !frame.getFormat().isCompatibleWith(mPortFormat)) {
            throw new RuntimeException("Frame passed to " + this + " is of incorrect type! "
                + "Expected " + mPortFormat + " but got " + frame.getFormat());
        }
    
public abstract voidclear()

public voidclose()

        if (mIsOpen) {
            if (mLogVerbose) Log.v(TAG, "Closing " + this);
        }
        mIsOpen = false;
    
public abstract booleanfilterMustClose()

public android.filterfw.core.FiltergetFilter()

        return mFilter;
    
public java.lang.StringgetName()

        return mName;
    
public android.filterfw.core.FrameFormatgetPortFormat()

        return mPortFormat;
    
public abstract booleanhasFrame()

public booleanisAttached()

        return mFilter != null;
    
public booleanisBlocking()

        return mIsBlocking;
    
public booleanisOpen()

        return mIsOpen;
    
public abstract booleanisReady()

public voidopen()

        if (!mIsOpen) {
            if (mLogVerbose) Log.v(TAG, "Opening " + this);
        }
        mIsOpen = true;
    
public abstract FramepullFrame()

public abstract voidpushFrame(Frame frame)

public voidsetBlocking(boolean blocking)

        mIsBlocking = blocking;
    
public voidsetChecksType(boolean checksType)

        mChecksType = checksType;
    
public abstract voidsetFrame(Frame frame)

public voidsetPortFormat(android.filterfw.core.FrameFormat format)

        mPortFormat = format;
    
public java.lang.StringtoString()

        return "port '" + mName + "' of " + mFilter;