/*
 * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden
 * 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:
 * Mateusz Parzonka - initial API and implementation
 */
package prm4j.indexing.staticdata;

import java.util.Arrays;

/**
 * Represents all less informative instances of the event instance which match its enable sets and are associated with
 * symbols, PLUS the compatible partial instances which map to parameter sets to fully instantiate joinable instances.
 */
public class ChainData {

    private final int[] nodeMask;
    private final int monitorSetId;

    public ChainData(int[] nodeMask, int monitorSetId) {
	super();
	this.nodeMask = nodeMask;
	this.monitorSetId = monitorSetId;
    }

    public int[] getNodeMask() {
	return nodeMask;
    }

    public int getMonitorSetId() {
	return monitorSetId;
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + monitorSetId;
	result = prime * result + Arrays.hashCode(nodeMask);
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	ChainData other = (ChainData) obj;
	if (monitorSetId != other.monitorSetId)
	    return false;
	if (!Arrays.equals(nodeMask, other.nodeMask))
	    return false;
	return true;
    }

    @Override
    public String toString() {
	return "ChainData [nodeMask=" + Arrays.toString(nodeMask) + ", monitorSetId=" + monitorSetId + "]";
    }

}

@@ -431,16 +431,59 @@
 .Arrays;
+%0Aimport java.util.List;%0A%0Aimport prm4j.Util;
 %0A%0A/**%0A *
@@ -947,32 +947,206 @@
 orSetId;%0A    %7D%0A%0A
+    public ChainData(List%3CInteger%3E nodeMask, int monitorSetId) %7B%0A%09super();%0A%09this.nodeMask = Util.toPrimitiveIntegerArray(nodeMask);%0A%09this.monitorSetId = monitorSetId;%0A    %7D%0A%0A
     public int%5B%5D

Add constructor accepting List<Integer> nodeMask to ChainData