org.mulgara.mrg
Class GraphImpl

java.lang.Object
  extended by org.mulgara.mrg.AbstractGraphExt
      extended by org.mulgara.mrg.AbstractGraph
          extended by org.mulgara.mrg.GraphImpl
All Implemented Interfaces:
AppendableGraph, Graph, GraphExt, WritableGraph

public class GraphImpl
extends AbstractGraph

A hashmap based RDF graph. This gives constant time lookups for basic operations, though without full indexing it can give linear time on some operations.


Field Summary
 
Fields inherited from interface org.mulgara.mrg.Graph
X
 
Constructor Summary
GraphImpl()
          Default constructor for an empty graph.
GraphImpl(Collection<Triple> triples)
          Builds a graph with a collection of triples.
 
Method Summary
protected
<X> Collection<X>
createCollection()
          Use a HashSet for efficient lookups.
protected
<X,Y> Map<X,Y>
createMap()
          Use hashmaps for efficient lookups.
 
Methods inherited from class org.mulgara.mrg.AbstractGraph
delete, delete, doesResourceExist, exportN3, exportN3, exportXML, exportXML, getObjects, getPredicates, getProperties, getRawProperties, getRdfList, getSubjects, getSubjects, getTriples, getValue, getValues, insert, insert, isAsserted, isAsserted, isEmpty, match, matchSubgraph, mergeInto, size, unionInto
 
Methods inherited from class org.mulgara.mrg.AbstractGraphExt
doesResourceExist, doesResourceExist, getProperties, getProperties, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, getValues, getValues, getValues, getValues, getValues, getValues, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mulgara.mrg.GraphExt
doesResourceExist, doesResourceExist, getProperties, getProperties, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getRdfList, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getSubjects, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, getValues, getValues, getValues, getValues, getValues, getValues, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, isAsserted, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchSubgraphX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX, matchX
 

Constructor Detail

GraphImpl

public GraphImpl()
Default constructor for an empty graph.


GraphImpl

public GraphImpl(Collection<Triple> triples)
Builds a graph with a collection of triples.

Parameters:
triples - The initial triples for the graph.
Method Detail

createMap

protected <X,Y> Map<X,Y> createMap()
Use hashmaps for efficient lookups.

Specified by:
createMap in class AbstractGraph
Returns:
an instance of a HashMap.

createCollection

protected <X> Collection<X> createCollection()
Use a HashSet for efficient lookups.

Specified by:
createCollection in class AbstractGraph
Returns:
an instance of a HashSet.


Copyright © 2011. All Rights Reserved.