/** * <p>Constructs and returns an array of <code>One2OneChannelInt</code> objects * which use the specified <code>ChannelDataStoreInt</code> object as a * buffer. * </p> * <p>The buffer supplied to this method is cloned before it is inserted into * the channel. This is why an array of buffers is not required. * </p> * * @param buffer the <code>ChannelDataStoreInt</code> to use. * @param n the size of the array of channels. * @return the array of buffered channels. * * @see jcsp.lang.BufferedChannelIntArrayFactory#createOne2One(jcsp.util.ints.ChannelDataStoreInt,int) * @see jcsp.util.ints.ChannelDataStoreInt */ public One2OneChannelInt[] createOne2One(ChannelDataStoreInt buffer, int n) { One2OneChannelInt[] toReturn = new One2OneChannelInt[n]; for (int i = 0; i < n; i++) { toReturn[i] = createOne2One(buffer); } return(toReturn); }
/** * Constructs and returns an array of <code>One2OneChannelInt</code> * objects. * * @param n the size of the array of channels. * @return the array of channels. * * @see jcsp.lang.ChannelIntArrayFactory#createOne2One(int) */ public One2OneChannelInt[] createOne2One(int n) { One2OneChannelInt[] toReturn = new One2OneChannelInt[n]; for (int i = 0; i < n; i++) { toReturn[i] = createOne2One(); } return(toReturn); }
public static One2OneChannelInt[] one2oneIntArray(int size, ChannelDataStoreInt data, int immunity) { One2OneChannelInt[] r = new One2OneChannelInt[size]; for (int i = 0; i < size; i++) { r[i] = one2oneInt(data, immunity); } return(r); }
public static One2OneChannelInt[] one2oneIntArray(int size) { One2OneChannelInt[] r = new One2OneChannelInt[size]; for (int i = 0; i < size; i++) { r[i] = one2oneInt(); } return(r); }