Informazioni sul documento
- Università
- Politecnico di Milano
- Corso di laurea
- Computer Engineering
- Materia
- Ingegneria del Software
- Classificazione
- Esame · Esame completo
- Contenuto
- Testo d’esame
- Formato originale
- Testo
- Testo ricercabile
Esame completo di Ingegneria del Software per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.
Esame completo di Ingegneria del Software per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.
Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.
Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.
Ingegneria del Software — Soluzione del Tema 10/07/2023 Esercizio 1 Si consideri la seguente classe immutabile Message. Ogni messaggio ha un contenuto, un mittente, un destinatario e un timestamp. Mittente e destinatario sono individuati univocamente da un identificatore, per semplicit `a un long. Ancora per semplicit`a, il timestamp `e un long (anzich´e un Date). public /*@ pure @ */ class Message { public Message(byte[] content, long recipientID, long senderID, long timestamp) {...} public byte [] content() {...} // returns the content of this public long recipientID() {...} // returns the recipientID of this public long senderID() {...} // returns the senderID of this public long timestamp() {...} // returns the timestamp of this } La seguente classe MessageManager descrive un gestore di messaggi. `E possibile inviare ed estrarre messaggi, vedere elenchi dei messaggi e degli utenti; in particolare, `e possibile fondere un altro gestore messaggi con quello corrente. public class MessageManager { // Builds a new empty manager public MessageManager() {...} // Returns the set of all valid ids, i.e., ids of recipients or senders of some message in the past. public /*@ pure @ */ Set<Long> allIds() {...} // Returns all messages yet to be delivered to the recipient having the given recipientId, // from the oldest to the newest. // Returns an empty list if the recipient is unknown or if there is no message to be delivered it. public /*@ pure @ */ List<Message> toId( long recipientId) {...} // Returns all messages, yet to be delivered, sent from the sender having the given senderId. // Throws an UnknownIdException if the sender is unknown. public /*@ pure @ */ Set<Message> fromId( long senderId) throws UnknownIdException {...} // Inserts a new message in the manager, with the…
Prima pagina del documento.