⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 category.java

📁 一个免费wap站
💻 JAVA
字号:
package com.eline.wap.resource.model;

import java.io.Serializable;

import com.eline.wap.common.model.Section;

/**
 * 
 * @author Lucifer
 * 资源分类
 */
public class Category extends Section implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static final int TYPE_UNDEFINED	= -1;
	public static final int TYPE_BOOK		= 0;
	public static final int TYPE_NEWS		= 1;
	public static final int TYPE_RING		= 2;
	public static final int TYPE_PICTURE	= 3;
	public static final int TYPE_J2ME		= 4;
	public static final int TYPE_ANIMATION	= 5;
	
	// 类目节点属性: 决定是最终产品还是中间目录
	public static final int ATTRIBUTE_ITEM	= 0;
	public static final int ATTRIBUTE_DIR	= 1;

	private int type;

	
	public Category() {
		type = TYPE_UNDEFINED;
	}

	public Category(int type) {
		this.type = type;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public String getName() {
		return super.getString("name", "NONAME");
	}
	
	public void setName(String name) {
		super.setString("name", name);
	}
	
	public int getCategoryAttribute() {
		return super.getInt("categoryAttribute", ATTRIBUTE_ITEM);
	}

	public void setCategoryAttribute(int categoryAttribute) {
		super.setInt("categoryAttribute", categoryAttribute);
	}
	
	public String getDescription() {
		return super.getString("description", "");
	}
	
	public void setDescription(String description) {
		super.setString("description", description);
	}

	private static final String[] CATEGORY_TYPES = {
		"书籍类目",
		"资讯类目",
		"铃声类目",
		"图片类目",
		"J2ME类目",
		"动画类目"
	};

	public String getDisplayTitle() {
		if (this.getType() < TYPE_BOOK && this.getType() > TYPE_ANIMATION)
			return "[未定义类型]" + this.getName();
		return "[" + CATEGORY_TYPES[this.getType()] + "]" + this.getName();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -