package com.ice.structure.Composite;

import java.util.Collections;

/**
 * @author ice
 * @blog https://blog.csdn.net/dreaming_coder
 * @description
 * @create 2021-10-28 10:25:24
 */
public abstract class Company {
    protected String name;

    public Company(String name) {
        this.name = name;
    }

    public abstract void add(Company c); // 增加

    public abstract void remove(Company c); // 移除

    public void display(int depth) {
        System.out.println(String.join("", Collections.nCopies(depth, "-")) + name);

    }

    public abstract void lineOfDuty(); // 履行职责
}
