source: fedd/abac-src/rbtm/engine/SimpleProofQueue.java @ 2c9fff0

axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change on this file since 2c9fff0 was 8780cbec, checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago

ABAC sources from Cobham

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package edu.stanford.peer.rbtm.engine;
2
3import java.util.*;
4
5/**
6 * SimpleProofQueue maintains two queues of nodes that have not been visited,
7 * one for forward, and one for backward.
8 */
9public class SimpleProofQueue implements ProofQueue
10{
11        //HashSet       forwardNodes = new HashSet();
12        //HashSet     backwardNodes = new HashSet();
13        LinkedList  forwardQueue = new LinkedList();
14        LinkedList  backwardQueue = new LinkedList();
15
16    public boolean hasUnexploredForwardNodes() { 
17        return !forwardQueue.isEmpty(); 
18    }
19
20    public boolean hasUnexploredBackwardNodes() { 
21        return !backwardQueue.isEmpty(); 
22    }
23
24    public ProofNode nextUnexploredForwardNode() { 
25        return (ProofNode)forwardQueue.removeFirst(); 
26    }
27
28    public ProofNode nextUnexploredBackwardNode() { 
29        return (ProofNode)backwardQueue.removeFirst(); 
30    }
31
32    public void addForwardNode(ProofNode node) {
33                //if (! forwardNodes.contains(node)) {
34                        forwardQueue.add(node);
35                //      forwardNodes.add(node);
36                //}
37    }
38
39    public void addBackwardNode(ProofNode node) {
40                //if (! backwardNodes.contains(node)) {
41                        backwardQueue.add(node);
42                //      backwardNodes.add(node);
43                //}
44    }
45}
Note: See TracBrowser for help on using the repository browser.