Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // f la class SELEMENT
- public void copy(SELEMENT selement){
- selement.auteur=this.auteur;
- selement.titre=this.auteur;
- selement.nombre=this.nombre;
- }
- // f class ELEMENT
- public ELEMENT copy()
- {
- ELEMENT element=new ELEMENT();
- element.editeur=this.editeur;
- CHAINON chainonOFthis=this.tete,chainonOFelement=element.tete;
- while(chainonOFthis.next!=null){
- SELEMENT e=new SELEMENT();
- ((SELEMENT)chainonOFthis.next.info).copy(e);
- CHAINON k=new CHAINON(e,null);
- chainonOFelement.next=k;
- chainonOFthis=chainonOFthis.next;chainonOFelement=chainonOFelement.next;
- }
- return element;
- }
- //f la class CATALOGUE
- public CATALOGUE copy(){
- CATALOGUE catalogue=new CATALOGUE();
- CHAINON chainonOFthis=this.tete,chainonOFcatalogue=catalogue.tete;
- while(chainonOFthis.next!=null)
- {
- ELEMENT e=((ELEMENT)chainonOFthis.next.info).copy();
- CHAINON temp=new CHAINON(e,null);
- chainonOFcatalogue.next=temp;
- chainonOFcatalogue=chainonOFcatalogue.next;
- chainonOFthis=chainonOFthis.next;
- }
- return catalogue;
- }
Advertisement
Add Comment
Please, Sign In to add comment