2019/07/01

Function 함수적 인터페이스는 매개값과 리턴값이 있는 applyXXX() 메소드를 가지고 있다. 이 메소드는 매개값을 리턴값으로 매핑(타입 변환)하는 역할을 한다. 인터페이스명 추상 메소드 설명 Function R apply(T t) 객체 T를 객체 R로 매핑 BiFunction R apply(T t, U u) 객체 T, U를 객체 R로 매핑 DoubleFunction R apply(double value) double를 객체 R로 매핑 IntFunction R apply(int value) int를 객체 R로 매핑 IntToDoubleFunction double applyAsDouble(int value) int를 double로 매핑 IntToLongFunction long applyAsLong(..
Supplier 함수적 인터페이스는 매개값은 없고 리턴값이 있는 getXXX() 메소드를 가지고 있다. 이 메소드들은 호출한 곳으로 데이터를 리턴(공급)하는 역할을 한다. 인터페이스명 추상 메소드 설명 Supplier T get() T 객체를 리턴 BooleanSupplier boolean getAsBoolean() boolean 값을 리턴 DoubleSupplier double getAsDouble() double 값을 리턴 IntSupplier int getAsInt() int 값을 리턴 LongSupplier long getAsLong() long 값을 리턴 public static void main(String[] args) { IntSupplier intSupplier = () ->{ int n..
Consumer 함수적 인터페이스는 리턴값이 없는 accept() 메소드를 가지고 있다. Consumer는 단지 매개값을 소비하는 역할만 하며, 소비한다는 말은 사용만하고 리턴값이 없다는 뜻이다. 인터페이스명 추상 메소드 설명 Consumer void accept(T t) 객체를 T를 받아 소비 BiConsumer void accept(T t, U u) 객체 T, U를 받아 소비 DoubleConsumer void accept(double value) double 값을 받아 소비 intConsumer void accept(int value) int 값을 받아 소비 LongConsumer void accept(long value) long 값을 받아 소비 ObjDoubleConsumer void accep..
깡냉쓰
'2019/07/01 글 목록