org.eclipse.rdf4j.sail.nativerdf.model.NativeIRI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rdf4j-sail-nativerdf Show documentation
Show all versions of rdf4j-sail-nativerdf Show documentation
Sail implementation that stores data directly to disk in dedicated file formats.
/*******************************************************************************
* Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/
package org.eclipse.rdf4j.sail.nativerdf.model;
import org.eclipse.rdf4j.model.impl.SimpleIRI;
import org.eclipse.rdf4j.sail.nativerdf.ValueStoreRevision;
public class NativeIRI extends SimpleIRI implements NativeResource {
private static final long serialVersionUID = -5888138591826143179L;
/*-----------*
* Constants *
*-----------*/
private volatile ValueStoreRevision revision;
private volatile int internalID;
/*--------------*
* Constructors *
*--------------*/
protected NativeIRI(ValueStoreRevision revision, int internalID) {
super();
setInternalID(internalID, revision);
}
public NativeIRI(ValueStoreRevision revision, String uri) {
this(revision, uri, UNKNOWN_ID);
}
public NativeIRI(ValueStoreRevision revision, String uri, int internalID) {
super(uri);
setInternalID(internalID, revision);
}
public NativeIRI(ValueStoreRevision revision, String namespace, String localname) {
this(revision, namespace + localname);
}
public NativeIRI(ValueStoreRevision revision, String namespace, String localname, int internalID) {
this(revision, namespace + localname, internalID);
}
/*---------*
* Methods *
*---------*/
@Override
public void setInternalID(int internalID, ValueStoreRevision revision) {
this.internalID = internalID;
this.revision = revision;
}
@Override
public ValueStoreRevision getValueStoreRevision() {
return revision;
}
@Override
public int getInternalID() {
return internalID;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o instanceof NativeIRI && internalID != NativeValue.UNKNOWN_ID) {
NativeIRI otherNativeURI = (NativeIRI) o;
if (otherNativeURI.internalID != NativeValue.UNKNOWN_ID && revision.equals(otherNativeURI.revision)) {
// NativeURI's from the same revision of the same native store, with
// both ID's set
return internalID == otherNativeURI.internalID;
}
}
return super.equals(o);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy