spiny94

Untitled

Sep 6th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. package ticketing;
  2.  
  3. public class Commento {
  4.  
  5.     private Ticket ticket;
  6.     private Utente u;
  7.     private String testo;
  8.     private long timestamp;
  9.    
  10.     public Commento(Ticket ticket, Utente u, String testo) {
  11.         this.ticket = ticket;
  12.         this.u = u;
  13.         this.testo = testo;
  14.         this.timestamp = System.currentTimeMillis();
  15.     }
  16.     public Utente getAutore() {
  17.         return u;
  18.     }
  19.     public Ticket getTicket() {
  20.         return ticket;
  21.     }
  22.     public String getTesto() {
  23.         return testo;
  24.     }
  25.     public long getTimestamp() {
  26.         return timestamp;
  27.     }}
  28.  
  29. package ticketing;
  30.  
  31. @SuppressWarnings("serial")
  32. public class InvalidInformationException extends Exception {
  33.  
  34. }
  35. package ticketing;
  36.  
  37. import java.util.LinkedList;
  38.  
  39. public class Prodotto{
  40.     private String id,  nome,  descrizione;
  41.     private LinkedList<Ticket> tickets = new LinkedList<Ticket>();
  42.    
  43.     public Prodotto(String id, String nome, String descrizione) {
  44.         this.id=id;
  45.         this.nome = nome;
  46.         this.descrizione=descrizione;
  47.     }
  48.  
  49.     public String getNome(){
  50.         return nome;
  51.     }
  52.  
  53.     public String getDescrizione(){
  54.         return descrizione;
  55.     }
  56.  
  57.     public String getCodice(){
  58.         return id;
  59.     }
  60.    
  61.     public long numeroTicket(){
  62.         return tickets.size();
  63.     }
  64.    
  65.     void addTicket(Ticket t){
  66.         tickets.addFirst(t);
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment