From ec95b81fcefe181af3164bcd458ce537a11035bb Mon Sep 17 00:00:00 2001 From: EspenTinius Date: Wed, 11 Feb 2026 13:20:44 +0100 Subject: [PATCH] classe metodene made the class methods, next commit i will document them --- .../edu/ntnu/idi/idatt2003/g40/mappe/Stock.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Stock.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Stock.java index aec6887..70d3dec 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Stock.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Stock.java @@ -14,4 +14,20 @@ public Stock(String symbol, String company, BigDecimal salesPrice){ this.symbol = symbol; this.company = company; } + + public String getSymbol(){ + return symbol; + } + + public String getCompany(){ + return company; + } + + public BigDecimal getSalesPrice() { + return prices.getLast(); + } + + public void addNewSalesPrice(BigDecimal price) { + prices.add(price); + } }