Document information
- University
- Politecnico di Milano
- Degree programme
- Computer Engineering
- Subject
- Ingegneria del Software
- Classification
- Exam · Full exam
- Content
- Exam paper only
- Original format
- Text
- Searchable text
Study material for Ingegneria del Software, shared by the Studwiz community and reviewed by moderators.
Study material for Ingegneria del Software, shared by the Studwiz community and reviewed by moderators.
Import quality: text was extracted directly from the original document.
Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.
Ingegneria del Software — Soluzione del Tema 15/02/2021 Esercizio 1 Si consideri la seguente classe Java PackageManager per gestire l’installazione di pacchetti software e delle loro dipendenze. I singoli pacchetti sono rappresentati dalla classe pura Package di cui riportiamo i metodi rilevanti. p u b l i c c l a s s PackageManager { / / R i t o r n a l o s p a z i o d i s c o d i s p o n i b i l e i n KByte . p u b l i c / *@ pure @ * / i n t a v a i l a b l e S i z e ( ) ; / / R i t o r n a t r u e s e e s o l o s e dep e ’ una d i p e n d e n z a d i r e t t a o i n d i r e t t a d i p e / / dep non e ’ a t t u a l m e n t e i n s t a l l a t a . p u b l i c / *@ pure @ * / b o o l e a n d e p T o I n s t a l l ( Package dep , Package p ) ; / / Se p non e ’ g i a ’ i n s t a l l a t o e c ’ e ’ s u f f i c i e n t e s p a z i o d i s c o , i n s t a l l a p e t u t t i / / i p a c c h e t t i da c u i p d i p e n d e d i r e t t a m e n t e o i n d i r e t t a m e n t e e che non sono i n s t a l l a t i . / / Se non c ’ e ’ s u f f i c i e n t e s p a z i o d i s c o l a n c i a l ’ e c c e z i o n e D i s k F u l l E x c e p t i o n . p u b l i c v o i d i n s t a l l ( Package p ) throws D i s k F u l l E x c e p t i o n ; / / R i t o r n a l ’ e l e n c o d e i p a c c h e t t i a t t u a l m e n t e i n s t a l l a t i p u b l i c / *@ pure @ * / Set <Package > g e t I n s t a l l e d ( ) ; } p u b l i c / *@ pure @ * / c l a s s Package { / / R i t o r n a l ’ i d e n t i f i c a t i v o u n i v o c o d e l p a c c h e t t o s o f t w a r e p u b l i c S t r i n g g e t I d ( ) ; / / R i t o r n a l a d i m e n s i o n e d e l p a c c h e t t o s o f t w a r e i n KBytes p u b l i c i n t g e t S i z e ( ) ; / / R i t o r n a l ’ e l e n c o d e i p a c c h e…
First page of the document.