OSDN Git Service

dao
[everfolder/source.git] / source / workspace / EverFolder / src / com / yuji / ef / dao / NodeFactory.java
1 package com.yuji.ef.dao;
2
3 public class NodeFactory {
4         private static NodeFactory instance = null;
5
6         public static NodeFactory getInstance(){
7                 if (instance == null){
8                         instance = new NodeFactory();
9                 }
10                 return instance;
11         }       
12         
13         private NodeFactory(){
14
15         }
16
17         public Node create(long id, int type, String guid, long parent, String name, String children){
18                 Node node = null;
19                 
20                 switch (type){
21                 case 1:
22                         // TODO
23                         node = new DirNode(name, null);
24                         break;
25                 case 2:
26                         // TODO
27                         node = new FileNode(name, null);
28                         break;
29                 }
30                 
31                 return node;
32         }
33 }