?? twotasksnet.java
字號:
// This is copyrighted source file, part of Rakiura JFern package. // See the file LICENSE for copyright information and the terms and conditions// for copying, distributing and modifications of Rakiura JFern package.// Copyright (C) 1999-2002 by Mariusz Nowostawski and others [http://www.rakiura.org]package org.rakiura.cpn.sample;/**/import java.util.List;import org.rakiura.cpn.*;import org.rakiura.cpn.lib.Sequence;/** * Simple example of two sequencial tasks. * *<br><br> * TwoTasksNet.java<br> * Created: Tue Oct 3 16:53:15 2000<br> * *@author <a href="mariusz@rakiura.org">Mariusz Nowostawski</a> *@version 2.1.0 $Revision: 1.7 $ */public class TwoTasksNet extends Sequence { public TwoTasksNet() { final List l = transitions(); final Transition t1 = (Transition) l.get(0); final OutputArc out1 = (OutputArc) t1.outputArcs().get(0); out1.setExpression(out1.new Expression() { public Multiset evaluate() { final Multiset out = new Multiset(); Object t = getMultiset().getAny(); int n = ((Number) t).intValue(); out.add(new Integer(n + 1)); return out; } }); final Transition t2 = (Transition) l.get(1); final OutputArc out2 = (OutputArc) t2.outputArcs().get(0); out2.setExpression(out2.new Expression() { public Multiset evaluate() { int n = ((Number) getMultiset().getAny()).intValue(); return new Multiset(new Integer(n + 1)); } }); } public TwoTasksNet(Multiset m) { this(); inputPlace().addTokens(m); } } // TwoTasksNet//////////////////// end of file ////////////////////
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -