Skip to content

Commit e709ab1

Browse files
author
Kay Hudson
committed
Add Docker commands
1 parent d3c4e6b commit e709ab1

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Stage 1: Build .jar
2+
FROM openjdk:13.0-jdk-slim as builder
3+
VOLUME /tmp
4+
COPY . .
5+
RUN ./gradlew test --tests StackTestCase

docker-compose.yaml

Whitespace-only changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
11
package com.galvanize;
2+
3+
import java.util.ArrayList;
4+
5+
public class Stack {
6+
public boolean empty;
7+
private ArrayList items;
8+
9+
public Stack() {
10+
this.empty = true;
11+
this.items = new ArrayList();
12+
}
13+
14+
public int count() {
15+
return this.items.size();
16+
}
17+
18+
public void push(Object item) {
19+
this.items.add(item);
20+
this.empty = false;
21+
}
22+
23+
public Object pop() {
24+
int lastIndex = this.count() -1;
25+
Object lastItem = this.items.get(lastIndex);
26+
this.items.remove(lastIndex);
27+
return lastItem;
28+
}
29+
30+
public Object peek() {
31+
int lastIndex = this.count() -1;
32+
return this.items.get(lastIndex);
33+
}
34+
}

0 commit comments

Comments
 (0)