Package org.eclipse.rdf4j.query.impl
Class SimpleDataset
- java.lang.Object
-
- org.eclipse.rdf4j.query.impl.SimpleDataset
-
- All Implemented Interfaces:
java.io.Serializable,Dataset
- Direct Known Subclasses:
DatasetImpl
public class SimpleDataset extends java.lang.Object implements Dataset, java.io.Serializable
A simple implementation of theDatasetinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<IRI>defaultGraphsprivate IRIdefaultInsertGraphprivate java.util.Set<IRI>defaultRemoveGraphsprivate java.util.Set<IRI>namedGraphsprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SimpleDataset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDefaultGraph(IRI graphURI)Adds a graph URI to the set of default graph URIs.voidaddDefaultRemoveGraph(IRI graphURI)Adds a graph URI to the set of default remove graph URIs.voidaddNamedGraph(IRI graphURI)Adds a graph URI to the set of named graph URIs.private voidappendURI(java.lang.StringBuilder sb, IRI uri)voidclear()Removes all graph URIs (both default and named) from this dataset.booleanequals(java.lang.Object o)java.util.Set<IRI>getDefaultGraphs()Gets the default graph URIs of this dataset.IRIgetDefaultInsertGraph()Gets the default insert graph URI of this dataset.java.util.Set<IRI>getDefaultRemoveGraphs()Gets the default remove graph URIs of this dataset.java.util.Set<IRI>getNamedGraphs()Gets the (unmodifiable) set of named graph URIs.inthashCode()booleanremoveDefaultGraph(IRI graphURI)Removes a graph URI from the set of default graph URIs.booleanremoveDefaultRemoveGraph(IRI graphURI)Removes a graph URI from the set of default remove graph URIs.booleanremoveNamedGraph(IRI graphURI)Removes a graph URI from the set of named graph URIs.voidsetDefaultInsertGraph(IRI defaultInsertGraph)java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
defaultRemoveGraphs
private final java.util.Set<IRI> defaultRemoveGraphs
-
defaultInsertGraph
private IRI defaultInsertGraph
-
defaultGraphs
private final java.util.Set<IRI> defaultGraphs
-
namedGraphs
private final java.util.Set<IRI> namedGraphs
-
-
Method Detail
-
getDefaultRemoveGraphs
public java.util.Set<IRI> getDefaultRemoveGraphs()
Description copied from interface:DatasetGets the default remove graph URIs of this dataset. An empty set indicates the the store's default behaviour should be used, if not otherwise indicated in the operation.- Specified by:
getDefaultRemoveGraphsin interfaceDataset
-
addDefaultRemoveGraph
public void addDefaultRemoveGraph(IRI graphURI)
Adds a graph URI to the set of default remove graph URIs.
-
removeDefaultRemoveGraph
public boolean removeDefaultRemoveGraph(IRI graphURI)
Removes a graph URI from the set of default remove graph URIs.- Returns:
- true if the URI was removed from the set, false if the set did not contain the URI.
-
getDefaultInsertGraph
public IRI getDefaultInsertGraph()
Description copied from interface:DatasetGets the default insert graph URI of this dataset. An null value indicates that the store's default behaviour should be used, if not otherwise indicated in the operation.- Specified by:
getDefaultInsertGraphin interfaceDataset- Returns:
- Returns the default insert graph.
-
setDefaultInsertGraph
public void setDefaultInsertGraph(IRI defaultInsertGraph)
- Parameters:
defaultInsertGraph- The default insert graph to used.
-
getDefaultGraphs
public java.util.Set<IRI> getDefaultGraphs()
Description copied from interface:DatasetGets the default graph URIs of this dataset. An empty default graph set and a non-empty named graph set indicates that the default graph is an empty graph. However, if both the default graph set and the named graph set are empty, that indicates that the store's default behaviour should be used.- Specified by:
getDefaultGraphsin interfaceDataset
-
addDefaultGraph
public void addDefaultGraph(IRI graphURI)
Adds a graph URI to the set of default graph URIs.
-
removeDefaultGraph
public boolean removeDefaultGraph(IRI graphURI)
Removes a graph URI from the set of default graph URIs.- Returns:
- true if the URI was removed from the set, false if the set did not contain the URI.
-
getNamedGraphs
public java.util.Set<IRI> getNamedGraphs()
Gets the (unmodifiable) set of named graph URIs.- Specified by:
getNamedGraphsin interfaceDataset
-
addNamedGraph
public void addNamedGraph(IRI graphURI)
Adds a graph URI to the set of named graph URIs.
-
removeNamedGraph
public boolean removeNamedGraph(IRI graphURI)
Removes a graph URI from the set of named graph URIs.- Returns:
- true if the URI was removed from the set, false if the set did not contain the URI.
-
clear
public void clear()
Removes all graph URIs (both default and named) from this dataset.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
appendURI
private void appendURI(java.lang.StringBuilder sb, IRI uri)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-