X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FDirectStatementImpl.java;h=61df61667b0cd397b3d1064dc373ea27cfc705ce;hp=4a26deeefb931bef4d5826c7220dc85a68f70cba;hb=c26409b1caf2f1e560d37c5befd11b442399c3fe;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DirectStatementImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DirectStatementImpl.java index 4a26deeef..61df61667 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DirectStatementImpl.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DirectStatementImpl.java @@ -1,69 +1,69 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package fi.vtt.simantics.procore.internal; - -import org.simantics.db.Resource; -import org.simantics.db.Statement; -import org.simantics.db.impl.ResourceImpl; -import org.simantics.db.impl.support.ResourceSupport; - -final public class DirectStatementImpl implements Statement { - - final ResourceSupport support; - final int s; - final int p; - final int o; - - DirectStatementImpl(ResourceSupport support, int s, int p, int o) { - this.support = support; - this.s = s; - this.p = p; - this.o = o; - } - - @Override - public Resource getObject() { - return new ResourceImpl(support, o); - } - - @Override - public Resource getPredicate() { - return new ResourceImpl(support, p); - } - - @Override - public Resource getSubject() { - return new ResourceImpl(support, s); - } - - @Override - public boolean isAsserted(Resource subject) { - return false; - } - - @Override - final public int hashCode() { - return 41 * ( 31 * s + p) + o; - } - - @Override - public boolean equals(Object object) { - if (this == object) - return true; - else if (object == null) - return false; - else if (!(object instanceof Statement)) - return false; - Statement r = (Statement)object; - return getSubject().equalsResource(r.getSubject()) && getPredicate().equalsResource(r.getPredicate()) && getObject().equalsResource(r.getObject()); - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package fi.vtt.simantics.procore.internal; + +import org.simantics.db.Resource; +import org.simantics.db.Statement; +import org.simantics.db.impl.ResourceImpl; +import org.simantics.db.impl.support.ResourceSupport; + +final public class DirectStatementImpl implements Statement { + + final ResourceSupport support; + final int s; + final int p; + final int o; + + DirectStatementImpl(ResourceSupport support, int s, int p, int o) { + this.support = support; + this.s = s; + this.p = p; + this.o = o; + } + + @Override + public Resource getObject() { + return new ResourceImpl(support, o); + } + + @Override + public Resource getPredicate() { + return new ResourceImpl(support, p); + } + + @Override + public Resource getSubject() { + return new ResourceImpl(support, s); + } + + @Override + public boolean isAsserted(Resource subject) { + return false; + } + + @Override + final public int hashCode() { + return 41 * ( 31 * s + p) + o; + } + + @Override + public boolean equals(Object object) { + if (this == object) + return true; + else if (object == null) + return false; + else if (!(object instanceof Statement)) + return false; + Statement r = (Statement)object; + return getSubject().equalsResource(r.getSubject()) && getPredicate().equalsResource(r.getPredicate()) && getObject().equalsResource(r.getObject()); + } +}