Word abstract -> interface
This commit is contained in:
		
							parent
							
								
									1bdb35a899
								
							
						
					
					
						commit
						422344097b
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		|  | @ -1,11 +1,11 @@ | |||
| package hatelace; | ||||
| 
 | ||||
| public abstract class Word { | ||||
|     public abstract <T> T getValue(); | ||||
|     public abstract Word add(Word other); | ||||
|     public abstract Word subtract(Word other); | ||||
|     public abstract Word multiply(Word other); | ||||
|     public abstract Word divide(Word other); | ||||
|     public abstract String toString(); | ||||
|     public abstract boolean equals(Object other); | ||||
| public interface Word { | ||||
|     <T> T getValue(); | ||||
|     Word add(Word other); | ||||
|     Word subtract(Word other); | ||||
|     Word multiply(Word other); | ||||
|     Word divide(Word other); | ||||
|     String toString(); | ||||
|     boolean equals(Object other); | ||||
| } | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ package hatelace.memtypes; | |||
| 
 | ||||
| import hatelace.Word; | ||||
| 
 | ||||
| public class IntWord extends Word { | ||||
| public class IntWord implements Word { | ||||
|     private Integer value; | ||||
| 
 | ||||
|     public IntWord(Integer value) { | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ package hatelace.memtypes; | |||
| 
 | ||||
| import hatelace.Word; | ||||
| 
 | ||||
| public class LongWord extends Word { | ||||
| public class LongWord implements Word { | ||||
|     private Long value; | ||||
| 
 | ||||
|     public LongWord(Long value) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus