Examples of apply()


Examples of com.github.mustachejava.reflect.guards.ClassGuard.apply()

public class CompiledGuardTest implements Opcodes {

  @Test
  public void testGuard() {
    ClassGuard stringClassGuard = new ClassGuard(0, "");
    assertTrue("string is ok", stringClassGuard.apply(new Object[]{"test"}));
    assertFalse("integer is not ok", stringClassGuard.apply(new Object[]{1}));
  }

  @Test
  public void testCompiledGuard() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
View Full Code Here

Examples of com.google.appengine.datanucleus.Utils.Function.apply()

    while (iter.hasNext()) {
      Object listKey = iter.next();
      Object key = listKey;
      Function funcKey = DATASTORE_TO_POJO_TYPE_FUNC.get(keyType);
      if (funcKey != null) {
        key = funcKey.apply(listKey);
      }

      Object listVal = iter.next();
      Object val = listVal;
      Function funcVal = DATASTORE_TO_POJO_TYPE_FUNC.get(valType);
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.PExpression.apply()

  public void caseAExistsExpression(AExistsExpression node) {
    // Special case. Exists is only ever an issue for variables, all
    // other expressions unconditionally exist.
    PExpression expression = node.getExpression();
    if (expression instanceof AVariableExpression) {
      expression.apply(this);
      if (currentJavaExpression.getType() == Type.VAR_NAME) {
        currentJavaExpression = callFindVariable(currentJavaExpression, false);
      }
      setResult(call(Type.BOOLEAN, "exists", currentJavaExpression));
    } else {
View Full Code Here

Examples of com.google.common.base.Function.apply()

              new Function<T, T>()
              {
                @Override
                public T apply(T input)
                {
                  cacheResults.add(cacheFn.apply(input));
                  return input;
                }
              }
          ),
          new Runnable()
View Full Code Here

Examples of com.google.common.base.Predicate.apply()

        // given
        Predicate elevenInCollectionPredicate = Predicates.in(Arrays.asList(11L, 22L, 33L, 44L));

        // then
        assertThat(elevenInCollectionPredicate.apply(11L)).isTrue();
    }

   
}
View Full Code Here

Examples of com.google.gxp.compiler.base.SpaceOperator.apply()

      if (textSegmentCount > 0) {
        // pull off leading spaces
        Matcher m = LEADING_SPACES.matcher(textSegments.get(0));
        String leadingSpaces = "";
        if (m.matches()) {
          leadingSpaces = exteriorSpaceOperator.apply(m.group(1));
          textSegments.set(0, m.group(2));
        }

        // pull off trailing spaces
        m = TRAILING_SPACES.matcher(textSegments.get(textSegmentCount - 1));
View Full Code Here

Examples of com.google.template.soy.shared.restricted.SoyJavaRuntimePrintDirective.apply()

          "Print directive '" + directiveName + "' used with the wrong number of" +
          " arguments (tag " + node.toSourceString() + ").");
    }

    try {
      return directive.apply(value, args);

    } catch (RuntimeException e) {
      throw new RenderException(String.format(
          "Failed in applying directive '%s' in tag \"%s\" due to exception: %s",
          directiveName, node.toSourceString(), e.getMessage()));
View Full Code Here

Examples of com.google.walkaround.slob.shared.StateAndVersion.apply()

        }
        ImmutableList<ChangeData<String>> reverseDeltas = deltaAccu.build();
        // Now iterate forward and apply the deltas.
        for (ChangeData<String> delta : Lists.reverse(reverseDeltas)) {
          try {
            state.apply(delta);
          } catch (ChangeRejected e) {
            throw new RuntimeException("Corrupt snapshot or delta history: "
                + objectId + " rejected delta " + delta + ": " + state);
          }
        }
View Full Code Here

Examples of com.googlecode.javacv.cpp.opencv_video.BackgroundSubtractorMOG.apply()

    CvMemStorage storage = CvMemStorage.create();
   
    while(true) {
      IplImage img = grabber.grab();
      IplImage fgmask = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1);
      backsub.apply(img, fgmask, 0.01);
     
      CvSeq contours = new CvSeq();
      cvFindContours(fgmask, storage, contours, Loader.sizeof(CvContour.class), CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
      while(contours != null && !contours.isNull()) {
        CvRect box = cvBoundingRect(contours, 0);
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong.apply()

    @ClientCompatibleTest
    public void apply_whenCalledWithNullFunction() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("apply_whenCalledWithNullFunction");

        ref.apply(null);
    }

    @Test
    @ClientCompatibleTest
    public void apply() {
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.