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;
14 final public class RelationInfo {
16 public static final RelationInfo[] NONE = new RelationInfo[0];
17 public final int predicate;
18 public final boolean isFunctional;
19 public final boolean isFinal;
20 public final boolean isAsserted;
22 public RelationInfo(final int predicate, final boolean isFunctional, final boolean isFinal, final boolean isAsserted) {
23 this.predicate = predicate;
24 this.isFunctional = isFunctional;
25 this.isFinal = isFinal;
26 this.isAsserted = isAsserted;
30 public String toString() {
31 return "RelationInfo[predicate=" + predicate + ", isFunctional=" + isFunctional + ", isFinal=" + isFinal + ", isAsserted=" + isAsserted + "]";
35 public int hashCode() {
36 return 31 * predicate;
40 public boolean equals(Object object) {
43 else if (object == null)
45 else if (RelationInfo.class != object.getClass())
47 RelationInfo r = (RelationInfo)object;
48 return r.predicate == predicate && r.isFinal == isFinal && r.isFunctional == isFunctional;