This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.v1; | |
import java.util.ArrayList; | |
import java.util.List; | |
public abstract class Beverage { | |
String description ; | |
List<ICondiment> condiments = new ArrayList<ICondiment>(); | |
public void addCondiment(ICondiment condiment){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example.simplecalculationsservice; | |
import java.util.logging.Logger; | |
import javax.jws.WebMethod; | |
import javax.jws.WebParam; | |
import javax.jws.WebResult; | |
import javax.jws.WebService; | |
import javax.jws.soap.SOAPBinding; | |
import javax.xml.bind.annotation.XmlSeeAlso; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
typedef struct List list_t; | |
struct List { | |
void * head; | |
list_t * tail; | |
}; | |
list_t * makelist (void * x, list_t * xs) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fs; | |
public interface CallBack { | |
void m(int e); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chp2.observerpattern.custom; | |
/** | |
* The objects who will broadcast events will implement this interface | |
*/ | |
public interface Subject { | |
public void registerObserver(Observer o); | |
public void removeObserver(Observer o); | |
public void notifyObservers(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chp1.designpuzzle; | |
public interface WeaponBehaviour { | |
String useWeapon(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chp1.simuduck.v3; | |
public interface Animal { | |
void makeSound(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fs; | |
public interface CallBack { | |
void m(int e); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fs; | |
/** | |
* This interface is responsible for holding the closures when it comes to map. | |
* It uses two generic types. One for the argument and one for the return type. | |
* @param <B> Generic type | |
* @param <A> Generic type | |
*/ | |
public interface Func<B,A> { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*We need a mutable list to store the list of registered callbacks.*) | |
(*The initial list will be empty.*) | |
val cbs : (int -> unit) list ref = ref [] | |
(*We need a public function to register the callbacks on the the callback list*) | |
fun registerCallBack f = | |
cbs := f::(!cbs) | |
(*When a specific action occurs we will call this function.*) | |
(*This function will call each call back with a parameter.*) |
NewerOlder