类 ClassThingManager
- java.lang.Object
-
- org.xmeta.thingManagers.ClassThingManager
-
- 所有已实现的接口:
ThingManager
public class ClassThingManager extends Object implements ThingManager
-
-
构造器概要
构造器 构造器 说明 ClassThingManager()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddThingManagerListener(ThingManagerListener listener)添加模型管理者事件。voidclearCache()清空缓存。booleancreateCategory(String categoryName)创建新的目录。URLfindResource(String name)查找资源。CategorygetCategory(String name)通过指定的目录名称获取目录。List<Category>getCategorys()返回模型管理者定义的根目录列表。ThingClassLoadergetClassLoader()返回模型管理器的类装载器。StringgetClassPath()获取模型管理器所依赖的类库的路径。StringgetName()获得模型管理者的名称。PropertiesgetProperties()获取模型管理器的配置。InputStreamgetResourceAsStream(String name)获取资源当作输入流,如果没有返回null。FilegetRootDir()返回项目所在的根目录。ThinggetThing(String thingName)通过模型的名称取得模型。List<ThingIndex>getThingIndexs(String categoryName)返回指定目录下的模型索引列表。List<ThingIndex>getThingIndexs(String categoryName, String descriptorPath)根据描述者获取指定目录下的模型索引列表。List<Thing>getThings(String categoryName)取得指定目录下的模型列表。List<Thing>getThings(String categoryName, String descriptorPath)根据模型描述者取得指定目录下的模型列表。voidinit(Properties properties)初始化模型管理器。booleanisSaveable()模型是否是可以保存的,如果不能保存,那么即使模型在内存中改变了,也不能同步到存储上。Iterator<Thing>iterator(String categoryName, boolean includeChildCategory)指定目录遍历该目录下的模型。Iterator<Thing>iterator(String categoryName, String descriptorPath, boolean includeChildCategory)指定模型的描述者遍历指定目录下的模型。voidrefresh()刷新模型管理者。voidrefresh(String categoryName, boolean includeChildCategory)刷新指定目录。booleanremove()删除此模型管理者,在此方法里实现清除此模型管理者的相关内容。booleanremove(Thing thing)从模型管理者中移除一个模型。booleanremoveCategory(String categoryName)删除一个目录。booleanremoveThingManagerListener(ThingManagerListener listener)删除模型管理者的监听事件。booleansave(Thing athing)保存一个模型。voidsetName(String name)设置模型管理器的名称。voidsetRootDir(File root)设置项目的所在根目录。
-
-
-
方法详细资料
-
addThingManagerListener
public void addThingManagerListener(ThingManagerListener listener)
从接口复制的说明:ThingManager添加模型管理者事件。- 指定者:
addThingManagerListener在接口中ThingManager- 参数:
listener- 模型管理者的事件
-
clearCache
public void clearCache()
从接口复制的说明:ThingManager清空缓存。- 指定者:
clearCache在接口中ThingManager
-
createCategory
public boolean createCategory(String categoryName)
从接口复制的说明:ThingManager创建新的目录。- 指定者:
createCategory在接口中ThingManager- 参数:
categoryName- 目录名称- 返回:
- 已创建或已存在的目录
-
findResource
public URL findResource(String name)
从接口复制的说明:ThingManager查找资源。- 指定者:
findResource在接口中ThingManager- 参数:
name- 资源名- 返回:
- 资源URL
-
getCategory
public Category getCategory(String name)
从接口复制的说明:ThingManager通过指定的目录名称获取目录。- 指定者:
getCategory在接口中ThingManager- 参数:
name- 目录的名称- 返回:
- 目录,如果不存在返回null
-
getCategorys
public List<Category> getCategorys()
从接口复制的说明:ThingManager返回模型管理者定义的根目录列表。- 指定者:
getCategorys在接口中ThingManager- 返回:
- 模型管理者的所有目录
-
getClassLoader
public ThingClassLoader getClassLoader()
从接口复制的说明:ThingManager返回模型管理器的类装载器。- 指定者:
getClassLoader在接口中ThingManager- 返回:
- 类装载器
-
getClassPath
public String getClassPath()
从接口复制的说明:ThingManager获取模型管理器所依赖的类库的路径。- 指定者:
getClassPath在接口中ThingManager- 返回:
- 类路径
-
getName
public String getName()
从接口复制的说明:ThingManager获得模型管理者的名称。- 指定者:
getName在接口中ThingManager- 返回:
- 模型管理者的名称
-
getResourceAsStream
public InputStream getResourceAsStream(String name)
从接口复制的说明:ThingManager获取资源当作输入流,如果没有返回null。- 指定者:
getResourceAsStream在接口中ThingManager- 参数:
name- 资源名- 返回:
- 资源输入流
-
getThing
public Thing getThing(String thingName)
从接口复制的说明:ThingManager通过模型的名称取得模型。 比方法一般是World调用的,应用中取模型请通过World,World负责缓存。- 指定者:
getThing在接口中ThingManager- 参数:
thingName- 模型的名称,此名称为全名(包含目录)- 返回:
- 模型
-
getThingIndexs
public List<ThingIndex> getThingIndexs(String categoryName)
从接口复制的说明:ThingManager返回指定目录下的模型索引列表。- 指定者:
getThingIndexs在接口中ThingManager- 参数:
categoryName- 目录名称- 返回:
- 目录索引列表
-
getThingIndexs
public List<ThingIndex> getThingIndexs(String categoryName, String descriptorPath)
从接口复制的说明:ThingManager根据描述者获取指定目录下的模型索引列表。- 指定者:
getThingIndexs在接口中ThingManager- 参数:
categoryName- 目录名称descriptorPath- 描述者路径- 返回:
- 目录索引列表
-
getThings
public List<Thing> getThings(String categoryName)
从接口复制的说明:ThingManager取得指定目录下的模型列表。- 指定者:
getThings在接口中ThingManager- 参数:
categoryName- 目录名称- 返回:
- 模型列表
-
getThings
public List<Thing> getThings(String categoryName, String descriptorPath)
从接口复制的说明:ThingManager根据模型描述者取得指定目录下的模型列表。- 指定者:
getThings在接口中ThingManager- 参数:
categoryName- 目录名称descriptorPath- 模型描述者的路径- 返回:
- 模型列表
-
iterator
public Iterator<Thing> iterator(String categoryName, boolean includeChildCategory)
从接口复制的说明:ThingManager指定目录遍历该目录下的模型。- 指定者:
iterator在接口中ThingManager- 参数:
categoryName- 目录名称includeChildCategory- 是否包含子目录- 返回:
- 模型遍历器
-
iterator
public Iterator<Thing> iterator(String categoryName, String descriptorPath, boolean includeChildCategory)
从接口复制的说明:ThingManager指定模型的描述者遍历指定目录下的模型。- 指定者:
iterator在接口中ThingManager- 参数:
categoryName- 目录名称descriptorPath- 描述者的路径includeChildCategory- 是否包含子目录- 返回:
- 模型遍历器
-
refresh
public void refresh()
从接口复制的说明:ThingManager刷新模型管理者。- 指定者:
refresh在接口中ThingManager
-
refresh
public void refresh(String categoryName, boolean includeChildCategory)
从接口复制的说明:ThingManager刷新指定目录。- 指定者:
refresh在接口中ThingManager- 参数:
categoryName- 目录includeChildCategory- 是否包含子目录
-
remove
public boolean remove()
从接口复制的说明:ThingManager删除此模型管理者,在此方法里实现清除此模型管理者的相关内容。- 指定者:
remove在接口中ThingManager- 返回:
- 是否成功
-
remove
public boolean remove(Thing thing)
从接口复制的说明:ThingManager从模型管理者中移除一个模型。- 指定者:
remove在接口中ThingManager- 参数:
thing- 要移除的模型- 返回:
- 已经被移除的模型,如果没有则返回null
-
removeCategory
public boolean removeCategory(String categoryName)
从接口复制的说明:ThingManager删除一个目录。- 指定者:
removeCategory在接口中ThingManager- 参数:
categoryName- 目录名称- 返回:
- 是否删除成功
-
removeThingManagerListener
public boolean removeThingManagerListener(ThingManagerListener listener)
从接口复制的说明:ThingManager删除模型管理者的监听事件。- 指定者:
removeThingManagerListener在接口中ThingManager- 参数:
listener- 模型管理者监听事件- 返回:
- 是否成功
-
save
public boolean save(Thing athing)
从接口复制的说明:ThingManager保存一个模型。- 指定者:
save在接口中ThingManager- 参数:
athing- 要保存的模型- 返回:
- 如果保存成功那么返回该模型的根父模型,否则返回null
-
init
public void init(Properties properties)
从接口复制的说明:ThingManager初始化模型管理器。- 指定者:
init在接口中ThingManager- 参数:
properties- 参数
-
isSaveable
public boolean isSaveable()
从接口复制的说明:ThingManager模型是否是可以保存的,如果不能保存,那么即使模型在内存中改变了,也不能同步到存储上。- 指定者:
isSaveable在接口中ThingManager- 返回:
-
setRootDir
public void setRootDir(File root)
从接口复制的说明:ThingManager设置项目的所在根目录。- 指定者:
setRootDir在接口中ThingManager
-
getRootDir
public File getRootDir()
从接口复制的说明:ThingManager返回项目所在的根目录。- 指定者:
getRootDir在接口中ThingManager- 返回:
-
setName
public void setName(String name)
从接口复制的说明:ThingManager设置模型管理器的名称。- 指定者:
setName在接口中ThingManager- 参数:
name- 模型管理器的名称
-
getProperties
public Properties getProperties()
从接口复制的说明:ThingManager获取模型管理器的配置。- 指定者:
getProperties在接口中ThingManager- 返回:
-
-