axis_examplecompt_changesinfo-opsversion-2.00version-3.01version-3.02
Last change
on this file since c410e3a4 was
8780cbec,
checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago
|
ABAC sources from Cobham
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[8780cbec] | 1 | package com.nailabs.abac.trust; |
---|
| 2 | |
---|
| 3 | import java.util.*; |
---|
| 4 | |
---|
| 5 | /** Simple structure for representing the completion state of a linking goal */ |
---|
| 6 | public class CompletionState extends Observable { |
---|
| 7 | /** |
---|
| 8 | * A node is complete when all of its children have either succeeded |
---|
| 9 | * or failed completion states (one state per linking solution child). |
---|
| 10 | * @see SatisfactionState.SATISFIED |
---|
| 11 | * @see SatisfactionState.FAILED |
---|
| 12 | * */ |
---|
| 13 | public static final String COMPLETE = "complete"; |
---|
| 14 | |
---|
| 15 | /** |
---|
| 16 | * A node is complete while any of its linking solution children have an |
---|
| 17 | * unknown satisfaction state. |
---|
| 18 | * @see SatisfactionState.UNKNOWN |
---|
| 19 | */ |
---|
| 20 | public static final String INCOMPLETE = "incomplete"; |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | /** encapsulated completion state */ |
---|
| 24 | private String state = INCOMPLETE; |
---|
| 25 | |
---|
| 26 | /** default constructor */ |
---|
| 27 | public CompletionState() { } |
---|
| 28 | |
---|
| 29 | /** explicit state constructor */ |
---|
| 30 | public CompletionState(boolean flag) { |
---|
| 31 | state = (flag)? COMPLETE: INCOMPLETE; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | /** accessor method for the completion state field */ |
---|
| 35 | public boolean isComplete() { return state.equals(COMPLETE); } |
---|
| 36 | |
---|
| 37 | /** modifier method for the completion state field */ |
---|
| 38 | public void setComplete(boolean flag) { |
---|
| 39 | state = (flag)? COMPLETE: INCOMPLETE; |
---|
| 40 | setChanged(); |
---|
| 41 | notifyObservers(); |
---|
| 42 | } |
---|
| 43 | } |
---|
| 44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.