Smaller DirectedGraphFactory example
This commit is contained in:
		
							parent
							
								
									442df91c9c
								
							
						
					
					
						commit
						1c1900c79a
					
				
					 1 changed files with 4 additions and 8 deletions
				
			
		
							
								
								
									
										12
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								README.md
									
										
									
									
									
								
							|  | @ -6,16 +6,12 @@ Um diese GUI nutzen zu müssen, | |||
| muss man die H1, | ||||
| sprich die Klasse `h07.graph.DirectedGraphImpl`, | ||||
| implementiert haben | ||||
| und eine Entsprechende Fabrik in der `Gruphi.main()` angeben. | ||||
| Die Einfachste Fabrik sieht in etwa so aus: | ||||
| und eine entsprechende Fabrik in der `Gruphi.main()` angeben. | ||||
| Die einfachste Fabrik sieht in etwa so aus: | ||||
| 
 | ||||
| ```java | ||||
| public class EmptyGraphFactory<V, A> implements DirectedGraphFactory<V, A> { | ||||
| 
 | ||||
|     @Override | ||||
|     public DirectedGraph<V, A> createDirectedGraph() { | ||||
|         return new DirectedGraphImpl<>(); | ||||
|     } | ||||
| public static <V, A> DirectedGraphFactory<V, A> defaultFactory() { | ||||
|     return DirectedGraphImpl::new; | ||||
| } | ||||
| ``` | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue