1 / 26

Kap 05 Abstrakte datastrukturer

Kap 05 Abstrakte datastrukturer. Arv - Implementering Interface / Abstrakte klasser / Konkrete klasser. extends. Interface. Interface. implements. Interface. Abstract class. implements. Interface. Concrete class. extends. Abstract class. Concrete class. extends. Concrete class.

keefer
Télécharger la présentation

Kap 05 Abstrakte datastrukturer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Kap 05 Abstrakte datastrukturer

  2. Arv - ImplementeringInterface / Abstrakte klasser / Konkrete klasser extends Interface Interface implements Interface Abstract class implements Interface Concrete class extends Abstract class Concrete class extends Concrete class Concrete class

  3. Klassehierarki I_Comparable A_Object Wrappers I_Container A_Container StackAsArray StackAsLinkedList I_Stack I_Queue QueueAsArray QueueAsLinkedList A_Graph GraphAsMatrix GraphAsLists I_Graph I_Tree A_Tree GeneralTree I_SearchTree BinaryTree BinarySearchTree A_SearchableContainer I_SearchableContainer OrderedListAsArray OrderedListAsLinkedList I_OrderedList SortedListAsArray SortedListAsLinkedList I_SortedList A_HashTable ChainedHashTable I_HashTable I_Set A_Set SetAsArray

  4. Klassehierarki - Abstrakte datastrukturer Interface Abstract class Wrapper class A_Object Int I_Comparable Dbl I_Container A_Container Chr A_SearchableContainer I_SearchableContainer Str I_Visitor A_Visitor I_Enumeration I_Iterator

  5. Arv - Klassehierarki Enhver Java-klasse X (inkludert array’er) vil alltid være arvet (direkte eller indirekte) fra en klasse kalt Object. Object Object X A X

  6. Klassen Object Litt av innholdet i klassen Object: public class Object { public Object( ); // creates a default object protected Object clone( ); // object cloning protected void finalize( ); // destroying object public boolean equals (Object obj); // equal if ref to the same object public final Class getClass ( ); // runtime class descript for the object public int hashCode ( ); // calculates a hash code for the obj public void notify( ); // wakes up a single waiting thread public void noifyAll( ); // wakes up all waiting threads public String toString ( ); // string representation of the object public final void wait( ); // causes the current thread to wait public final void wait(long timeout); // waiting in milliseconds public final void wait(long timeout, int nanos) // waiting for nanoseconds }

  7. Interface I_Comparable Interface I_Comparable som inneholder sammenligningsmetoder:

  8. Abstract (1/4)A_Object Abstract A_Object som implementerer I_Comparable

  9. Abstract (2/4)A_Object Abstract A_Object som implementerer I_Comparable

  10. Abstract A_Object (3/4) Implementering av compareog innføring av abstract compareTo

  11. Abstract A_Object (4/4) Implementering av clone

  12. Wrapper classes Original class Wrapper class Wrapper classes: W_Chr : Character W_Str : String W_Int : Integer W_Dbl : Double

  13. Wrappers A_Object Int I_Comparable Dbl Chr Str

  14. W_Chr

  15. W_Str

  16. W_Int

  17. W_Dbl

  18. Interface I_Container Interface I_Container som inneholder andre objekter:

  19. AbstractA_Container (1/2) Abstract class A_Container som implementerer I_Container:

  20. AbstractA_Container (2/2) Abstract class A_Container som implementerer I_Container:

  21. Interface I_Visitor Interface I_Visitor som benyttes til traversering av objekter:

  22. Abstrakt klasse A_Visitor Abstrakt klasse A_Visitor som implementerer I_Visotor:

  23. Interface I_Enumeration Interface I_Enumeration som benyttes til traversering av objekter:

  24. Interface I_Iterator Interface I_Iterator som benyttes til traversering av objekter:

  25. Interface I_SearchableContainer Interface I_SearchableContainer som gir søkemuligheter:

  26. END

More Related