Examples of Predicate


Examples of org.apache.commons.collections.Predicate

     */
    protected org.andromda.metafacades.uml.AttributeFacade handleFindAttribute(final java.lang.String name)
    {
        return (AttributeFacade)CollectionUtils.find(
            this.getAttributes(true),
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    final AttributeFacade attribute = (AttributeFacade)object;
                    return StringUtils.trimToEmpty(attribute.getName()).equals(name);
View Full Code Here

Examples of org.apache.commons.collections.Predicate

    protected java.util.Collection handleGetStaticAttributes()
    {
        Collection attributes = this.getAttributes();
        CollectionUtils.filter(
            attributes,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return ((AttributeFacade)object).isStatic();
                }
View Full Code Here

Examples of org.apache.commons.collections.Predicate

    protected java.util.Collection handleGetInstanceAttributes()
    {
        Collection attributes = this.getAttributes();
        CollectionUtils.filter(
            attributes,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return !((AttributeFacade)object).isStatic();
                }
View Full Code Here

Examples of org.apache.commons.collections.Predicate

    protected java.util.Collection handleGetStaticOperations()
    {
        Collection operations = this.getOperations();
        CollectionUtils.filter(
            operations,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return ((OperationFacade)object).isStatic();
                }
View Full Code Here

Examples of org.apache.commons.collections.Predicate

    protected java.util.Collection handleGetInstanceOperations()
    {
        Collection operations = this.getOperations();
        CollectionUtils.filter(
            operations,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return !((OperationFacade)object).isStatic();
                }
View Full Code Here

Examples of org.apache.commons.collections.Predicate

    protected java.util.Collection handleGetAbstractions()
    {
        final Collection dependencies = new ArrayList(this.metaObject.getClientDependencies());
        CollectionUtils.filter(
            dependencies,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return object instanceof Abstraction;
                }
View Full Code Here

Examples of org.apache.commons.collections.Predicate

                    return ((AssociationEndFacade)object).getOtherEnd();
                }
            });
        CollectionUtils.filter(
            connectingEnds,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return ((AssociationEndFacade)object).isNavigable();
                }
View Full Code Here

Examples of org.apache.commons.collections15.Predicate

       
        vv.getRenderContext().setVertexShapeTransformer(new ClusterVertexShapeFunction());
       
        final PredicatedParallelEdgeIndexFunction eif = PredicatedParallelEdgeIndexFunction.getInstance();
        final Set exclusions = new HashSet();
        eif.setPredicate(new Predicate() {

      public boolean evaluate(Object e) {
       
        return exclusions.contains(e);
      }});
View Full Code Here

Examples of org.apache.commons.functor.Predicate

import org.apache.commons.functor.Procedure;
import org.apache.commons.functor.core.algorithm.WhileDo;

public class CommonsFunctorExample {
  public static void main(final String[] args) {
    Predicate predicate = new Predicate() {
      public boolean test() {
        return true;
      }
    };
    Procedure procedure = new Procedure() {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textsem.Predicate

      if (parserNode.srlInfo.isPredicate()) {
        int headId = i;
        if (!headIdToPredicate.containsKey(headId)) {
          // We have not encountered this predicate yet, so create it
          Predicate pred = this.createPredicate(jCas, parserNode.srlInfo.rolesetId, token);
          headIdToPredicate.put(headId, pred);
          pred.setRelations(new EmptyFSList(jCas));
        }
      } else {
        for (SRLHead head : parserNode.srlInfo.heads) {
          Predicate predicate;

          // Determine which predicate this argument belongs to
          if (!headIdToPredicate.containsKey(head.headId)) {
            // The predicate hasn't been encountered, so create it
            BaseToken headToken = tokens.get(head.headId - 1);
            predicate = this.createPredicate(jCas, parserNode.srlInfo.rolesetId, headToken);
            headIdToPredicate.put(head.headId, predicate);
          } else {
            predicate = headIdToPredicate.get(head.headId);
          }

          // Append this argument to the predicate's list of arguments
          if (!predicateArguments.containsKey(predicate)) {
            predicateArguments.put(predicate, new ArrayList<SemanticArgument>());
          }
          List<SemanticArgument> argumentList = predicateArguments.get(predicate);

          // Create the semantic argument and store for later link creation
          SemanticArgument argument = createArgument(jCas, head, token);
          argumentList.add(argument);
        }
      }
    }

    // Create relations between predicates and arguments
    for (Map.Entry<Predicate, List<SemanticArgument>> entry : predicateArguments.entrySet()) {
      Predicate predicate = entry.getKey();
     
      List<SemanticRoleRelation> relations = new ArrayList<SemanticRoleRelation>();
      for (SemanticArgument argument : entry.getValue()) {
        SemanticRoleRelation relation = new SemanticRoleRelation(jCas);
        relation.setArgument(argument);
        relation.setPredicate(predicate);
        relation.setCategory(argument.getLabel());
        relation.addToIndexes();
        relations.add(relation);
        argument.setRelation(relation);
      }
     
      FSList relationsList = ListFactory.buildList(jCas, relations.toArray(new TOP[relations.size()]));
      predicate.setRelations(relationsList);
    }
  }
View Full Code Here
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.