当前位置: 首页>>代码示例>>Java>>正文


Java FramedGraph类代码示例

本文整理汇总了Java中com.tinkerpop.frames.FramedGraph的典型用法代码示例。如果您正苦于以下问题:Java FramedGraph类的具体用法?Java FramedGraph怎么用?Java FramedGraph使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FramedGraph类属于com.tinkerpop.frames包,在下文中一共展示了FramedGraph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processVertex

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
public Object processVertex(final Incidence incidence, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Vertex element) {
    if (ClassUtilities.isGetMethod(method)) {
        return new FramedEdgeIterable(framedGraph, element.getEdges(incidence.direction(), incidence.label()), incidence.direction(), ClassUtilities.getGenericClass(method));
    } else if (ClassUtilities.isAddMethod(method)) {
        
        switch(incidence.direction()) {
        case OUT:
            return framedGraph.addEdge(null, element, ((VertexFrame) arguments[0]).asVertex(), incidence.label(), Direction.OUT, method.getReturnType());
        case IN:
            return framedGraph.addEdge(null, ((VertexFrame) arguments[0]).asVertex(), element, incidence.label(), Direction.IN, method.getReturnType());
        case BOTH:
            throw new UnsupportedOperationException("Direction.BOTH it not supported on 'add' or 'set' methods");
        }
            
    } else if (ClassUtilities.isRemoveMethod(method)) {
        framedGraph.removeEdge(((EdgeFrame) arguments[0]).asEdge());
        return null;
    }

    return null;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:22,代码来源:IncidenceAnnotationHandler.java

示例2: getFramedPropertyType

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
public static Class<?> getFramedPropertyType(final FramedGraph<?> graph, final Object frame, CharSequence key) {
	Class<?> result = Object.class;
	Map<CaseInsensitiveString, Method> getters = null;
	if (frame instanceof EdgeFrame) {
		getters = getGetters(graph, (EdgeFrame) frame);
	} else {
		getters = getGetters(graph, (VertexFrame) frame);
	}
	if (!(key instanceof CaseInsensitiveString)) {
		key = new CaseInsensitiveString(key);
	}
	Method crystal = getters.get(key);
	if (crystal != null) {
		result = crystal.getReturnType();
	}
	return result;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:18,代码来源:DGraphUtils.java

示例3: FramedVertexList

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
public FramedVertexList(final FramedGraph<? extends Graph> framedGraph, final Vertex sourceVertex, final Iterable<Vertex> list,
		final Class<T> kind) {
	super(framedGraph, list, kind);
	//		Throwable t = new Throwable();
	//		t.printStackTrace();
	sourceVertex_ = sourceVertex;
	if (list instanceof List) {
		list_ = (List<Vertex>) list;
	} else {
		list_ = new ArrayList<Vertex>();
		Iterator<Vertex> itty = list.iterator();
		while (itty.hasNext()) {
			Vertex v = null;
			try {
				v = itty.next();
			} catch (Exception e) {
				//do nothing
			}
			if (v != null) {
				list_.add(v);
			}
		}
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:25,代码来源:FramedVertexList.java

示例4: afterDoService

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public void afterDoService(final HttpServletRequest request) {
	Map<String, FramedGraph<?>> graphs = getGraphMap();
	for (FramedGraph graph : graphs.values()) {
		if (graph instanceof DFramedTransactionalGraph) {
			Object raw = ((DFramedTransactionalGraph) graph).getBaseGraph();
			if (raw instanceof DGraph) {
				((DGraph) raw).clearTransaction();
			}
		}
	}
	REQUEST_CTX.set(null);
	Factory.termThread();
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:15,代码来源:ODAGraphService.java

示例5: initElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public void initElement(Class<?> kind, FramedGraph<?> framedGraph, Element element) {
	Class<?> typeHoldingTypeField = typeRegistry.getTypeHoldingTypeField(kind);
	if (typeHoldingTypeField != null) {
		TypeValue typeValue = kind.getAnnotation(TypeValue.class);
		if (typeValue != null) {
			element.setProperty(typeHoldingTypeField.getAnnotation(TypeField.class).value(), typeValue.value());
		}
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:11,代码来源:TypeManager.java

示例6: FramedEdgeIterable

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
/**
* @deprecated Use {@link #FramedEdgeIterable(FramedGraph, Iterable, Class)}, in combination with {@link InVertex} and {@link OutVertex}.
*/
  public FramedEdgeIterable(final FramedGraph<? extends Graph> framedGraph, final Iterable<Edge> iterable, final Direction direction, final Class<T> kind) {
      this.framedGraph = framedGraph;
      this.iterable = iterable;
      this.kind = kind;
      this.direction = direction;
  }
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:10,代码来源:FramedEdgeIterable.java

示例7: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final OutVertex annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Element element, final Direction direction) {
    if (element instanceof Edge) {
    	return framedGraph.frame(((Edge)element).getVertex(Direction.OUT), method.getReturnType());
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:OutVertexAnnotationHandler.java

示例8: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final Incidence annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Element element, final Direction direction) {
    if (element instanceof Vertex) {
        return processVertex(annotation, method, arguments, framedGraph, (Vertex) element);
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:IncidenceAnnotationHandler.java

示例9: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final Adjacency annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph,
        final Element element, final Direction direction) {
    if (element instanceof Vertex) {
        return processVertex(annotation, method, arguments, framedGraph, (Vertex) element);
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:10,代码来源:AdjacencyAnnotationHandler.java

示例10: addEdges

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
private void addEdges(final Adjacency adjacency, final FramedGraph framedGraph, final Vertex vertex, Vertex newVertex) {
    switch(adjacency.direction()) {
    case OUT:
        framedGraph.addEdge(null, vertex, newVertex, adjacency.label());
        break;
    case IN:
        framedGraph.addEdge(null, newVertex, vertex, adjacency.label());
        break;
    case BOTH:
        throw new UnsupportedOperationException("Direction.BOTH it not supported on 'add' or 'set' methods");
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:AdjacencyAnnotationHandler.java

示例11: removeEdges

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
private void removeEdges(final Direction direction, final String label, final Vertex element, final Vertex otherVertex, final FramedGraph framedGraph) {
    for (final Edge edge : element.getEdges(direction, label)) {
        if (null == otherVertex || edge.getVertex(direction.opposite()).equals(otherVertex)) {
            framedGraph.removeEdge(edge);
        }
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:8,代码来源:AdjacencyAnnotationHandler.java

示例12: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final Domain annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Element element, final Direction direction) {
    if (element instanceof Edge) {
        return processEdge(annotation, method, arguments, framedGraph, (Edge) element, direction);
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:DomainAnnotationHandler.java

示例13: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final Range annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Element element, final Direction direction) {
    if (element instanceof Edge) {
        return processEdge(annotation, method, arguments, framedGraph, (Edge) element, direction);
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:RangeAnnotationHandler.java

示例14: processElement

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
@Override
public Object processElement(final InVertex annotation, final Method method, final Object[] arguments, final FramedGraph framedGraph, final Element element, final Direction direction) {
    if (element instanceof Edge) {
        return framedGraph.frame(((Edge)element).getVertex(Direction.IN), method.getReturnType());
    } else {
        throw new UnsupportedOperationException();
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:InVertexAnnotationHandler.java

示例15: AbstractFrameComparator

import com.tinkerpop.frames.FramedGraph; //导入依赖的package包/类
public AbstractFrameComparator(final FramedGraph<?> graph, final List<? extends CharSequence> keys, final boolean desc) {
	if (graph instanceof DFramedTransactionalGraph) {
		graph_ = (DFramedTransactionalGraph<?>) graph;
	}
	keys_ = (List<CharSequence>) keys;
	desc_ = desc;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:8,代码来源:DGraphUtils.java


注:本文中的com.tinkerpop.frames.FramedGraph类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。