package com.ice.structure.Adapter;

/**
 * @author ice
 * @blog https://blog.csdn.net/dreaming_coder
 * @description
 * @create 2021-10-26 16:12:59
 */
public class TwoToThreeAdapter implements ThreePower{
    /**
     * 使用委托来完成适配
     */
    private final TwoPower twoPower;

    public TwoToThreeAdapter(TwoPower twoPower) {
        this.twoPower = twoPower;
    }


    @Override
    public void powerByThree() {
        System.out.println("借助组合适配器转化二项电");
        twoPower.powerByTwo();
    }
}
