程序包 org.xmeta.codes
类 TxtThingCoder
- java.lang.Object
-
- org.xmeta.codes.TxtThingCoder
-
- 所有已实现的接口:
ThingCoder
public class TxtThingCoder extends Object implements ThingCoder
提供一种文本格式的编码,目的是保持读写性能以及可以方便的在版本管理中合并。- 作者:
- Administrator
-
-
构造器概要
构造器 构造器 说明 TxtThingCoder()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanacceptType(String type)是否是制定类型的编码者。voiddecode(Thing thing, InputStream in, long lastModifyed)解码一个输入流到事物中。voiddecodeIndex(ThingIndex thingIndex, InputStream in, long lastModifyed)只解码用于索引事物的部分,事物索引通常用于UI的导航中。voidencode(Thing thing, OutputStream out)编码一个事物到输出流中。String[]getCodeTypes()返回编码器所支持的所有类型。StringgetType()返回编码器的类型,通常是文件的后缀名。
-
-
-
字段详细资料
-
TYPE
public static String TYPE
-
-
方法详细资料
-
decode
public void decode(Thing thing, InputStream in, long lastModifyed)
从接口复制的说明:ThingCoder解码一个输入流到事物中。- 指定者:
decode在接口中ThingCoder- 参数:
thing- 事物in- 输入流lastModifyed- 如果为0表示解码时不能获取时间,可能需要在格式中去解
-
decodeIndex
public void decodeIndex(ThingIndex thingIndex, InputStream in, long lastModifyed)
从接口复制的说明:ThingCoder只解码用于索引事物的部分,事物索引通常用于UI的导航中。- 指定者:
decodeIndex在接口中ThingCoder- 参数:
thingIndex- 事物索引in- 输入流lastModifyed- 如果为0表示解码时不能获取时间,可能需要在格式中去解
-
encode
public void encode(Thing thing, OutputStream out)
从接口复制的说明:ThingCoder编码一个事物到输出流中。- 指定者:
encode在接口中ThingCoder- 参数:
thing- 事物out- 输出流
-
getType
public String getType()
从接口复制的说明:ThingCoder返回编码器的类型,通常是文件的后缀名。- 指定者:
getType在接口中ThingCoder- 返回:
- 类型
-
acceptType
public boolean acceptType(String type)
从接口复制的说明:ThingCoder是否是制定类型的编码者。- 指定者:
acceptType在接口中ThingCoder- 参数:
type- 类型- 返回:
- 如果是返回ture,否则返回false
-
getCodeTypes
public String[] getCodeTypes()
从接口复制的说明:ThingCoder返回编码器所支持的所有类型。- 指定者:
getCodeTypes在接口中ThingCoder- 返回:
- 编码器所支持的所有类型。
-
-