-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneralHandler.java
More file actions
32 lines (31 loc) · 946 Bytes
/
GeneralHandler.java
File metadata and controls
32 lines (31 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
*An abstract class that holds the reference of either the Queue or the Stack
*/
public abstract class GeneralHandler implements IntQueueStackHandler{
protected Queue<Integer> intQ;
protected Stack<Integer> intSt;
/**
*The default GeneralHandler empty constructor
*/
public GeneralHandler(){
//empty constructor
}
/**
*GeneralHandler constructor, initializes a new GeneralHandler
*with a reference to a Queue of Integers
*@param intQ the reference to the Queue of Integers.
*/
public GeneralHandler(Queue<Integer> intQ){
this.intQ = intQ;
//intSt = null by default
}
/**GeneralHandler overloaded constructor, initializes
*a new GeneralHandler from a given one
*@param intSt the reference to the Stack of Integers.
*/
public GeneralHandler(Stack<Integer> intSt){
this.intSt = intSt;
//intQ = null by default
}
//by default processRequest() is here and not implemented
}