Skip to content

Instantly share code, notes, and snippets.

@RubyTemple
Created January 29, 2020 11:38
Show Gist options
  • Save RubyTemple/05c8f6c3c6cdf89ade3914cd230c4aa0 to your computer and use it in GitHub Desktop.
Save RubyTemple/05c8f6c3c6cdf89ade3914cd230c4aa0 to your computer and use it in GitHub Desktop.
/**
*
* @author RubyTemple
*/
public class Evento {
private String titolo,testo;
private int data;
private Utente creatore;
public final short MAX_LIKE = 100;
private short[] like = new short[100];
private short counter = 0;
public Evento(String titolo, String testo, int data, Utente creatore){
this.titolo = titolo;
this.testo = testo;
this.data = data;
this.creatore = creatore;
}
public String getTitolo(){
return titolo;
}
public String getTesto(){
return testo;
}
public int getdData(){
return data;
}
public Utente getCreatore(){
return creatore;
}
public void setLike(Utente u){
for(short i = 0 ; i < counter; i++){
if(u.getId() != like[i] || like == null){
like[i] = u.getId();
}
}
}
public short[] getLike(){
return like;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment