genericcallbackevent.java

来自「sea是一个基于seda模式的实现。这个设计模式将系统分为很多stage。每个s」· Java 代码 · 共 52 行

JAVA
52
字号
/* * Copyright (c) 2003, The Regents of the University of California, through * Lawrence Berkeley National Laboratory (subject to receipt of any required * approvals from the U.S. Dept. of Energy). All rights reserved. */package gov.lbl.dsd.sea.event;import gov.lbl.dsd.sea.Stage;/** * A multi-purpose generic event containing an arbitrary object as a message, the * stage from which the event originates, as well as an optional arbitrary * informational object, either of which may be <code>null</code>. *  * @author whoschek@lbl.gov, modified by kberket@lbl.gov * @author $Author: hoschek3 $ * @version $Revision: 1.4 $, $Date: 2004/07/27 05:08:08 $ */public class GenericCallbackEvent extends CallbackEvent {    protected Object msg; // the message to communicate    protected Object info; // optional further information such as "write",    // "read", a URL, etc.    public GenericCallbackEvent(Stage source, Object msg) {        this(source, msg, null);    }    public GenericCallbackEvent(Stage source, Object msg, Object info) {        super(source);        this.msg = msg;        this.info = info;    }    public Object getMessage() {        return this.msg;    }    public Object getInfo() {        return this.info;    }    public String toString() {        return super.toString() +                //(getMessage() != null ? ", msg.type=" + getMessage().getClass().getName() : "") +                ", msg=" + getMessage() +                (getInfo() != null ? ", info=" + getInfo() : "") +                (getInfo() instanceof byte[] ? ", info.toString=" + new String((byte[]) this.getInfo()) : "");    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?