Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 /*
  * Carrot2 project.
  *
  * Copyright (C) 2002-2012, Dawid Weiss, Stanisław Osiński.
  * All rights reserved.
  *
  * Refer to the full license file "carrot2.LICENSE"
  * in the root folder of the repository checkout or at:
 * http://www.carrot2.org/carrot2.LICENSE
 */
package org.carrot2.util.attribute;
A predicate that tests whether an AttributeDescriptor belongs to any of the provided levels.
public final class LevelsPredicate implements Predicate<AttributeDescriptor>
    private final AttributeLevel [] levels;
    public LevelsPredicate(AttributeLevel... levels)
    {
        this. = levels;
    }
    public boolean apply(AttributeDescriptor descriptor)
    {
        for (AttributeLevel level : )
        {
            if (level.equals(descriptor.metadata.getLevel()))
            {
                return true;
            }
        }
        return false;
    }
New to GrepCode? Check out our FAQ X