Package smack.down

Examples of smack.down.Callback$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


       
        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

            if (i % 6 == 0) {
                sixes.add(new Integer(i));
            }
        }

        truePred = new Predicate() {
            public boolean evaluate(Object x) {
                return true;
            }
        };

        falsePred = new Predicate() {
            public boolean evaluate(Object x) {
                return true;
            }
        };

        evenPred = new Predicate() {
            public boolean evaluate(Object x) {
                return (((Integer) x).intValue() % 2 == 0);
            }
        };

        oddPred = new Predicate() {
            public boolean evaluate(Object x) {
                return (((Integer) x).intValue() % 2 == 1);
            }
        };

        threePred = new Predicate() {
            public boolean evaluate(Object x) {
                return (((Integer) x).intValue() % 3 == 0);
            }
        };

        fourPred = new Predicate() {
            public boolean evaluate(Object x) {
                return (((Integer) x).intValue() % 4 == 0);
            }
        };
View Full Code Here

            // success
        }
    }

    private void verifyElementsInPredicate(final String[] elements) {
        Predicate pred = new Predicate() {
            public boolean evaluate(Object x) {
                for (int i = 0; i < elements.length; i++)
                    if (elements[i].equals(x))
                        return true;
                return false;
View Full Code Here

     *
     * @param i the Iterator to "filter"
     * @return "filtered" iterator
     */
    protected FilterIterator makePassThroughFilter(Iterator i) {
        Predicate pred = new Predicate() {
            public boolean evaluate(Object x) {
                return true;
            }
        };
        return new FilterIterator(i, pred);
View Full Code Here

     *
     * @param i the Iterator to "filter"
     * @return "filtered" iterator
     */
    protected FilterIterator makeBlockAllFilter(Iterator i) {
        Predicate pred = new Predicate() {
            public boolean evaluate(Object x) {
                return false;
            }
        };
        return new FilterIterator(i, pred);
View Full Code Here

    }
   
    //--------------------------------------------------------------------------

    protected Predicate stringPredicate() {
        return new Predicate() {
            public boolean evaluate(Object o) {
                return o instanceof String;
            }
        };
    }
View Full Code Here

    }
   
    //--------------------------------------------------------------------------
   
    protected Predicate stringPredicate() {
        return new Predicate() {
            public boolean evaluate(Object o) {
                return o instanceof String;
            }
        };
    }
View Full Code Here

    Action action = new Augmentation();
    action.setOwner(player1);
   
    assertEquals(2, m1.getStrength());
   
    action.play(m1, new Callback(){});
   
    assertEquals(6, m1.getStrength());
   
    player1.endTurn(new Callback(){});
   
    assertEquals(2, m1.getStrength());
  }
View Full Code Here

    assertEquals(5, m2.getStrength());
    assertEquals(7, m3.getStrength());
    assertEquals(3, m4.getStrength());
    assertEquals(6, m5.getStrength());
   
    action.play(new Callback(){});
   
    assertEquals(3, m1.getStrength());
    assertEquals(6, m2.getStrength());
    assertEquals(8, m3.getStrength());
    assertEquals(4, m4.getStrength());
    assertEquals(7, m5.getStrength());
   
    player1.endTurn(new Callback(){});
   
    assertEquals(2, m1.getStrength());
    assertEquals(5, m2.getStrength());
    assertEquals(7, m3.getStrength());
    assertEquals(3, m4.getStrength());
View Full Code Here

TOP

Related Classes of smack.down.Callback$Predicate

Copyright © 2018 www.massapicom. 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.