Examples of Root


Examples of aa.Root

    }
  }

  public void testJCasAccessing() throws Exception {
    try {
      Root r1 = new Root(jcas);
      r1.setArrayFloat(new FloatArray(jcas, 2));
      r1.setArrayFloat(0, (float) 3.0);
      r1.setArrayFloat(1, (float) 2.5);
      assertTrue(3.0 == r1.getArrayFloat(0));
      assertTrue(2.5 == r1.getArrayFloat(1));

      Root r2 = new Root(jcas);
      r2.setArrayRef(new FSArray(jcas, 3));
      EndOfSentence eos1 = new EndOfSentence(jcas);
      EndOfSentence eos2 = new EndOfSentence(jcas);

      r2.setArrayRef(0, eos1);
      r2.setArrayRef(1, eos2);
      assertTrue(r2.getArrayRef(0).equals(eos1));
      assertTrue(r2.getArrayRef(1).equals(eos2));

      r2.setArrayInt(new IntegerArray(jcas, 1));
      r2.setArrayInt(0, 17);
      assertTrue(r2.getArrayInt(0) == 17);
      IntegerArray ia = r2.getArrayInt();
      assertTrue(ia.get(0) == 17);

      r2.setArrayString(new StringArray(jcas, 2));
      r2.setArrayString(0, "zero");
      r2.setArrayString(1, "one");
      assertTrue(r2.getArrayString(0).equals("zero"));
      assertTrue(r2.getArrayString(1).equals("one"));

      // error paths
      // array out of bounds
      try {
        r2.getArrayString(2);
      } catch (LowLevelException e) {
        if (e.getError() != LowLevelException.ARRAY_INDEX_OUT_OF_RANGE)
          assertTrue(false);
      }
      try {
        r2.setArrayString(-1, "should fail");
      } catch (LowLevelException e) {
        if (e.getError() != LowLevelException.ARRAY_INDEX_OUT_OF_RANGE)
          assertTrue(false);
      }

      // null values
      r2.setArrayString(0, null);
      r2.setArrayRef(0, null);
      r2.setArrayRef(null);
      r2.setArrayString(null);
      r2.setPlainRef(null);
      r2.setPlainString(null);
      assertTrue(null == r2.getPlainString());
      assertTrue(null == r2.getPlainRef());
      try {
        r2.getArrayRef(0);
      } catch (LowLevelException e) {
        if (e.getError() != LowLevelException.NULL_ARRAY_ACCESS)
          assertTrue(false);
      }
      assertTrue(null == r2.getArrayString());
      assertTrue(null == r2.getArrayRef());

      r2.addToIndexes();
      r1.addToIndexes();

      JFSIndexRepository jfsi = jcas.getJFSIndexRepository();
      FSIndex fsi1 = jfsi.getIndex("all", Root.type);
      FSIterator fsit1 = fsi1.iterator();
View Full Code Here

Examples of bibliothek.gui.dock.station.split.Root

           
            // +0.1: to work against a later integer conversion that might round down
            double deltaWidth = size.getWidth() + 0.001 - modified.width;
            double deltaHeight = size.getHeight() + 0.001 - modified.height;
           
            Root root = leaf.getRoot();
            deltaWidth /= root.getWidthFactor();
            deltaHeight /= root.getHeightFactor();
           
            return new ResizeRequest(
                    deltaWidth,
                    deltaHeight,
                    size.isWidthSet() ? 1 : -1,
View Full Code Here

Examples of bibliothek.gui.dock.station.split.SplitDockPerspective.Root

    if( dockable.getParent() != intern() ) {
      if( dockable.getParent() != null ) {
        dockable.getParent().remove( dockable );
      }

      Root root = getRoot();
      SplitDockPerspective.Leaf leaf = new SplitDockPerspective.Leaf( dockable, null, null, -1 );

      if( root.getChild() == null ) {
        root.setChild( leaf );
      }
      else {
        root.setChild( new SplitDockPerspective.Node( Orientation.HORIZONTAL, 0.5, leaf, root.getChild(), null, null, -1 ) );
      }
    }

    // store
    delegate.setFullscreen( dockable );
View Full Code Here

Examples of com.google.appengine.tck.benchmark.support.Root

        // do it w/o Tx
        doInsert(generateData(N, parent));
    }

    protected Key<Root> getRootKey() {
        Root root = new Root();
        root.setName("Root" + System.currentTimeMillis());
        return ObjectifyService.ofy().save().entity(root).now();
    }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

  public BoundTree apply(ReparentedTree reparentedTree) {
    Set<Callable> requirements = Sets.newHashSet();
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(reparentedTree.getAlerts());

    Root oldRoot = reparentedTree.getRoot();
    ServiceDirectory serviceDirectory =
        new ScopedServiceDirectory(alertSetBuilder,
                                   baseServiceDirectory,
                                   oldRoot.getName().getPackageName(),
                                   oldRoot.getImports());

    Root newRoot = oldRoot.acceptVisitor(
        new Visitor(alertSetBuilder, schemaFactory, serviceDirectory, requirements));

    return new BoundTree(reparentedTree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                         newRoot, requirements);
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

*/
public class Validator implements Function<EscapedTree, ValidatedTree> {

  public ValidatedTree apply(EscapedTree tree) {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new Visitor(alertSetBuilder));

    return new ValidatedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(), root);
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public Callable getCallable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getCallable();
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public InstanceCallable getInstanceCallable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getInstanceCallable();
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

   *
   * @throws IllegalArgumentException if {@code templateName} is not fully
   * qualified (ie: does not have a package name)
   */
  public Implementable getImplementable(TemplateName templateName) {
    Root root = getRoot(templateName);
    return (root == null) ? null : root.getImplementable();
  }
View Full Code Here

Examples of com.google.gxp.compiler.base.Root

*/
public class ContentFlattener implements Function<ValidatedTree, ContentFlattenedTree> {

  public ContentFlattenedTree apply(ValidatedTree tree) {
    AlertSetBuilder alertSetBuilder = new AlertSetBuilder(tree.getAlerts());
    Root root = tree.getRoot().acceptVisitor(new Visitor(alertSetBuilder));

    return new ContentFlattenedTree(tree.getSourcePosition(), alertSetBuilder.buildAndClear(),
                                    root);
  }
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.