Difference between revisions of "Atomic Stack Assignment"
Jump to navigation
Jump to search
(→Stack) |
|||
Line 25: | Line 25: | ||
===NotThreadSafeStack=== | ===NotThreadSafeStack=== | ||
[https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/NotThreadSafe.html @NotThreadSafe] | [https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/NotThreadSafe.html @NotThreadSafe] | ||
+ | |||
+ | {{CodeToImplement|NotThreadSafeStack|constructor<br/>nodeConstructor<br/>push<br/>peek<br/>pop|stack.notthreadsafe.exercise}} | ||
+ | |||
====constructor and instance variables==== | ====constructor and instance variables==== | ||
====nodeConstructor==== | ====nodeConstructor==== | ||
Line 32: | Line 35: | ||
===ConcurrentStack=== | ===ConcurrentStack=== | ||
[https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/ThreadSafe.html @ThreadSafe] | [https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/ThreadSafe.html @ThreadSafe] | ||
+ | |||
+ | {{CodeToImplement|ConcurrentStack|constructor<br/>nodeConstructor<br/>push<br/>peek<br/>pop|stack.concurrent.exercise}} | ||
====constructor and instance variables==== | ====constructor and instance variables==== | ||
====nodeConstructor==== | ====nodeConstructor==== | ||
Line 39: | Line 44: | ||
===AtomicStack=== | ===AtomicStack=== | ||
[https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/ThreadSafe.html @ThreadSafe] | [https://www.javadoc.io/static/com.google.code.findbugs/jsr305/3.0.1/javax/annotation/concurrent/ThreadSafe.html @ThreadSafe] | ||
+ | |||
+ | {{CodeToImplement|AtomicStack|constructor<br/>nodeConstructor<br/>push<br/>peek<br/>pop|stack.atomic.exercise}} | ||
====constructor and instance variables==== | ====constructor and instance variables==== | ||
====nodeConstructor==== | ====nodeConstructor==== |
Revision as of 03:16, 6 November 2022
Contents
Code To Implement
Node
public interface Node<E> { E value(); Optional<Node<E>> nextNode(); }
DefaultNode
@Immutable class DefaultNode.
class: | DefaultNode.java | |
methods: | value nextNode |
|
package: | stack.node.exercise | |
source folder: | main/src/main/java |
constructor and instance variables
value
nextNode
Stack
public interface Stack<E> { void push(E value); Optional<E> peek(); Optional<E> pop(); }
NotThreadSafeStack
class: | NotThreadSafeStack.java | |
methods: | constructor nodeConstructor push peek pop |
|
package: | stack.notthreadsafe.exercise | |
source folder: | student/src/main/java |
constructor and instance variables
nodeConstructor
push
peek
pop
ConcurrentStack
class: | ConcurrentStack.java | |
methods: | constructor nodeConstructor push peek pop |
|
package: | stack.concurrent.exercise | |
source folder: | student/src/main/java |
constructor and instance variables
nodeConstructor
push
peek
pop
AtomicStack
class: | AtomicStack.java | |
methods: | constructor nodeConstructor push peek pop |
|
package: | stack.atomic.exercise | |
source folder: | student/src/main/java |
constructor and instance variables
nodeConstructor
push
peek
pop
Testing
class: | StackTestSuite.java | |
package: | stack.exercise | |
source folder: | testing/src/test/java |
DefaultNode
class: | _DefaultNodeTestSuite.java | |
package: | stack.node.exercise | |
source folder: | testing/src/test/java |
NotThreadSafeStack
class: | _NotThreadSafeStackTestSuite.java | |
package: | stack.notthreadsafe.exercise | |
source folder: | testing/src/test/java |
ConcurrentStack
class: | __ConcurrentStackTestSuite.java | |
package: | stack.concurrent.exercise | |
source folder: | testing/src/test/java |
sequential
class: | _ConcurrentStackSequentialTestSuite.java | |
package: | stack.concurrent.exercise | |
source folder: | testing/src/test/java |
parallel
class: | _ConcurrentStackParallelTestSuite.java | |
package: | stack.concurrent.exercise | |
source folder: | testing/src/test/java |
AtomicStack
class: | __AtomicStackTestSuite.java | |
package: | stack.atomic.exercise | |
source folder: | testing/src/test/java |
sequential
class: | _AtomicStackSequentialTestSuite.java | |
package: | stack.atomic.exercise | |
source folder: | testing/src/test/java |
parallel
class: | _AtomicStackParallelTestSuite.java | |
package: | stack.atomic.exercise | |
source folder: | testing/src/test/java |