`

例_实_建_创_口_接_过_通

 
阅读更多
public interface IJieKou
{
    public void getObjectName();
}

public interface IPerson
{
    IPerson eINSTANCE = Person.init();
    public User createUser();
}

public interface IUser extends IJieKou
{
    public boolean enter(String name, String pass);
}

public interface IPersonConst
{
    public static final String USER_INFO = "User"; //$NON-NLS-1$
}

public class Person implements IPerson
{
    public static IPerson init()
    {
        return new Person();
    }
    @Override
    public User createUser()
    {
        return new User();
    }
}

public class User implements IUser
{
    private int u_Id;
   
    private String u_Name;
   
    private String u_Sex;
   
    private String u_Address;
...
}

public static void main(String[] args)
    {
        User cUser = IPerson.eINSTANCE.createUser();
        cUser.setU_Id(0);
        cUser.setU_Name("xbliuc"); //$NON-NLS-1$
        addJieKou(cUser);
        System.out.println(map.size());
    }
    public static void addJieKou(IJieKou jieKou)
    {
        String key = ""; //$NON-NLS-1$
        if (jieKou instanceof User)
        {
            key = IPersonConst.USER_INFO;
        }
        List<IJieKou> list = getList(key);
        list.add(jieKou);
        map.put(key, list);
    }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics