KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > validate > nrl > ActionSet


1 package com.thaiopensource.validate.nrl;
2
3 class ActionSet {
4   private ResultAction resultAction;
5   private NoResultAction[] noResultActions = new NoResultAction[0];
6
7   ResultAction getResultAction() {
8     return resultAction;
9   }
10
11   void setResultAction(ResultAction resultAction) {
12     this.resultAction = resultAction;
13   }
14
15   void addNoResultAction(NoResultAction action) {
16     NoResultAction[] actions = new NoResultAction[noResultActions.length + 1];
17     System.arraycopy(noResultActions, 0, actions, 0, noResultActions.length);
18     actions[noResultActions.length] = action;
19     noResultActions = actions;
20   }
21
22   NoResultAction[] getNoResultActions() {
23     return noResultActions;
24   }
25
26   ActionSet changeCurrentMode(Mode mode) {
27     ActionSet actions = new ActionSet();
28     if (this.resultAction != null)
29       actions.resultAction = this.resultAction.changeCurrentMode(mode);
30     actions.noResultActions = new NoResultAction[this.noResultActions.length];
31     for (int i = 0; i < actions.noResultActions.length; i++)
32       actions.noResultActions[i] = this.noResultActions[i].changeCurrentMode(mode);
33     return actions;
34   }
35 }
36
Popular Tags