📄 didlobject.java
字号:
/*
* Created on 30.mar.2006
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package no.auc.one.portableplayer.lms;
import java.io.*;
import no.auc.one.portableplayer.utils.Serializable;
public abstract class DidlObject implements Serializable {
//
// Hope this string is unique enough :)
//
protected static final String SERIALIZED_NULL_STRING_PROPERTY = "NEXNEXNEX";
// Required elements
protected int id;
protected int parentId;
protected boolean restricted;
protected String title;
private final static String CLASSTYPE = "object";
// Optional elements
protected String creator = SERIALIZED_NULL_STRING_PROPERTY;
protected String res = SERIALIZED_NULL_STRING_PROPERTY;
protected String writeStatus = SERIALIZED_NULL_STRING_PROPERTY;
public DidlObject(int id, int parentId, String title, boolean restricted) {
this.id = id;
this.parentId = parentId;
this.restricted = restricted;
this.title = title;
}
public DidlObject(DataInput di) throws IOException {
id = di.readInt();
parentId = di.readInt();
restricted = di.readBoolean();
title = di.readUTF();
creator = di.readUTF();
res = di.readUTF();
writeStatus = di.readUTF();
}
/**
* Properties are written in the same order as in the Content Directory
* Service specification for 'object', except upnp:class which must be
* written by an implementation class.
*/
public void serialize(DataOutput dos) throws IOException {
dos.writeInt(id);
dos.writeInt(parentId);
dos.writeBoolean(restricted);
dos.writeUTF(title);
dos.writeUTF(creator);
dos.writeUTF(res);
dos.writeUTF(writeStatus);
}
public String toString() {
return title;
}
public int id() {
return id;
}
public int parentId() {
return parentId;
}
public String title() {
return title;
}
public String classType() {
return CLASSTYPE;
}
public boolean isRestricted(){
return restricted;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getCreator() {
return creator;
}
public void setResource(String res) {
this.res = res;
}
public String getResource() {
return res;
}
public void setWriteStatus(String writeStatus) {
this.writeStatus = writeStatus;
}
public String getWriteStatus() {
return writeStatus;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -