1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db;
16 final public class RelationInfo {
18 public static final RelationInfo[] NONE = new RelationInfo[0];
19 public final int predicate;
20 public final boolean isFunctional;
21 public final boolean isFinal;
22 public final boolean isAsserted;
24 public RelationInfo(final int predicate, final boolean isFunctional, final boolean isFinal, final boolean isAsserted) {
25 this.predicate = predicate;
26 this.isFunctional = isFunctional;
27 this.isFinal = isFinal;
28 this.isAsserted = isAsserted;
32 public String toString() {
33 return "RelationInfo[predicate=" + predicate + ", isFunctional=" + isFunctional + ", isFinal=" + isFinal + ", isAsserted=" + isAsserted + "]";
37 public int hashCode() {
38 return 31 * predicate;
42 public boolean equals(Object object) {
45 else if (object == null)
47 else if (RelationInfo.class != object.getClass())
49 RelationInfo r = (RelationInfo)object;
50 return r.predicate == predicate && r.isFinal == isFinal && r.isFunctional == isFunctional;