Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.Element


  }

  @Override
  public Vertex getVertex(final Object id) {
    Vertex result = null;
    Element chk = getElementCache().get(id);
    if (chk != null) {
      if (chk instanceof Vertex) {
        result = (Vertex) chk;
      } else {
        throw new IllegalStateException("Requested id of " + String.valueOf(id) + " is already in cache but is a "
            + chk.getClass().getName());
      }
    } else {
      Map<String, Object> delegate = findElementDelegate(id);
      if (delegate != null) {
        Object typeChk = delegate.get(org.openntf.domino.graph2.DElement.TYPE_FIELD);
View Full Code Here


  }

  @Override
  public Edge addEdge(final Object id) {
    Edge result = null;
    Element chk = getElementCache().get(id);
    if (chk != null) {
      if (chk instanceof Edge) {
        result = (Edge) chk;
      } else {
        throw new IllegalStateException("Requested id of " + String.valueOf(id) + " is already in cache but is a "
            + chk.getClass().getName());
      }
    } else {
      Map<String, Object> delegate = addElementDelegate(id);
      if (delegate != null) {
        Object typeChk = delegate.get(org.openntf.domino.graph2.DElement.TYPE_FIELD);
View Full Code Here

  }

  @Override
  public Edge getEdge(final Object id) {
    Edge result = null;
    Element chk = getElementCache().get(id);
    if (chk != null) {
      if (chk instanceof Edge) {
        result = (Edge) chk;
      } else {
        throw new IllegalStateException("Requested id of " + String.valueOf(id) + " is already in cache but is a "
            + chk.getClass().getName());
      }
    } else {
      Map<String, Object> delegate = findElementDelegate(id);
      if (delegate != null) {
        Object typeChk = delegate.get(org.openntf.domino.graph2.DElement.TYPE_FIELD);
View Full Code Here

    }
  }

  private Element getCache(final Object id) {
    Map<Object, Element> cache = getCache();
    Element result = null;
    //    synchronized (cache) {
    result = cache.get(id);
    //    }
    return result;
  }
View Full Code Here

        RippleList stack = arg;
        RippleValue first = stack.getFirst();
        stack = stack.getRest();

        if (first instanceof ElementValue) {
            Element el = ((ElementValue) first).getElement();
            solutions.put(stack.push(BlueprintsLibrary.createRippleValue(el.getId(), mc)));
        }
    }
View Full Code Here

    public static void verifyElementOrder(Iterator<? extends Element> elements, String key, Order order, int expectedCount) {
        Comparable previous = null;
        int count = 0;
        while (elements.hasNext()) {
            Element element = elements.next();
            Comparable current = (Comparable)element.getProperty(key);
            if (previous != null) {
                int cmp = previous.compareTo(current);
                assertTrue(previous + " <> " + current + " @ " + count,
                        order == Order.ASC ? cmp <= 0 : cmp >= 0);
            }
View Full Code Here

                for (Order order : Order.values()) {
                    for (Iterable<? extends Element> iter : ImmutableList.of(
                            tx.query().has("text", Text.CONTAINS, words[i]).orderBy(orderKey, order).vertices(),
                            tx.query().has("text", Text.CONTAINS, words[i]).orderBy(orderKey, order).edges()
                    )) {
                        Element previous = null;
                        int count = 0;
                        for (Element element : iter) {
                            if (previous != null) {
                                int cmp = ((Comparable) element.getProperty(orderKey)).compareTo(previous.getProperty(orderKey));
                                assertTrue(element.getProperty(orderKey) + " <> " + previous.getProperty(orderKey),
                                        order == Order.ASC ? cmp >= 0 : cmp <= 0);
                            }
                            previous = element;
                            count++;
                        }
View Full Code Here

TOP

Related Classes of com.tinkerpop.blueprints.Element

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.