Package org.cellprofiler.imageset.filter

Source Code of org.cellprofiler.imageset.filter.AbstractURLPredicateBase

/**
* CellProfiler is distributed under the GNU General Public License.
* See the accompanying file LICENSE for details.
*
* Copyright (c) 2003-2009 Massachusetts Institute of Technology
* Copyright (c) 2009-2014 Broad Institute
* All rights reserved.
*
* Please see the AUTHORS file for credits.
*
* Website: http://www.cellprofiler.org
*/
package org.cellprofiler.imageset.filter;

import java.util.List;

import org.cellprofiler.imageset.ImageFile;
import org.cellprofiler.imageset.filter.Filter.BadFilterExpressionException;

abstract public class AbstractURLPredicateBase  implements
  FilterPredicate<ImageFile, String> {

  protected FilterPredicate<String, ?> subpredicate;

  public AbstractURLPredicateBase() {
    super();
  }

  public void setSubpredicates(List<FilterPredicate<String, ?>> subpredicates)
      throws BadFilterExpressionException {
        if (subpredicates.size() != 1) {
          throw new BadFilterExpressionException(String.format("The %s predicate takes a single subpredicate", getSymbol()));
        }
        subpredicate = subpredicates.get(0);
      }

  public void setLiteral(String literal) throws BadFilterExpressionException {
    throw new BadFilterExpressionException(String.format("The %s predicate does not take a literal", getSymbol()));
  }

  public Class<ImageFile> getInputClass() {
    return ImageFile.class;
  }

  public Class<String> getOutputClass() {
    return String.class;
  }

}
TOP

Related Classes of org.cellprofiler.imageset.filter.AbstractURLPredicateBase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.