类的使用
cn.wjybxx.concurrent.Context
使用Context的程序包
-
cn.wjybxx.concurrent中Context的使用
返回Context的cn.wjybxx.concurrent中的方法修饰符和类型方法说明Context.childWith(Object state, ICancelToken cancelToken, T blackboard, Object sharedProps) Context.childWithBlackboard(T blackboard) Context.childWithBlackboard(T blackboard, Object sharedProps) Context.childWithState(Object state) Context.childWithState(Object state, ICancelToken cancelToken) Context.newContext(Context<T> parent, Object state, ICancelToken cancelToken, T blackboard, Object sharedProps) 用于子类重写static <U> Context<U> Context.ofBlackboard(U blackboard) static <U> Context<U> Context.ofBlackboard(U blackboard, Object sharedProps) static <U> Context<U> Context.ofCancelToken(ICancelToken cancelToken) static <U> Context<U> static <U> Context<U> Context.ofState(Object state, ICancelToken cancelToken) static <U> Context<U> Context.ofState(Object state, ICancelToken cancelToken, U blackboard, Object sharedProps) Context.parent()父上下文 由于我们没有提供默认的黑板实现,因此需要支持用户迭代上下文。Context.root()根上下文 1.根上下文中可能保存着一些有用的行为。Context.with(Object state, ICancelToken cancelToken, T blackboard, Object sharedProps) Context.withBlackboard(T blackboard) Context.withBlackboard(T blackboard, Object sharedProps) Context.withState(Object state, ICancelToken cancelToken) 参数类型为Context的cn.wjybxx.concurrent中的方法修饰符和类型方法说明Context.newContext(Context<T> parent, Object state, ICancelToken cancelToken, T blackboard, Object sharedProps) 用于子类重写参数类型为Context的cn.wjybxx.concurrent中的构造器限定符构造器说明Context(Context<T> parent, Object state, ICancelToken cancelToken, T blackboard, Object sharedProps) 一般不建议直接调用该方法,而是通过withBlackboard(Object)等创建子上下文,否则无法处理上下文继承问题。