Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.0 kB
1
Indexable
Never
package bean;

import java.util.ArrayList;
import java.util.List;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author nikol
 */
public class stockPrice {

    private List<String> podrzani = new ArrayList<>();

    public stockPrice() {
        podrzani.add("AAPL");
        podrzani.add("MSFT");
        podrzani.add("YHOO");
        podrzani.add("AMZN");
        podrzani.add("TBN");

    }

    public int getCena(String simbol) {
        String cena = " ";

        if (podrzani.contains(simbol)) {
            int randNum = 1 + (int) (Math.random() * 100);
            return randNum;
        } else {
            return 0;
        }
    }

    public List<String> getPodrzani() {
        return podrzani;
    }

    public void setPodrzani(List<String> podrzani) {
        this.podrzani = podrzani;
    }

}