作者:郑郑郑克_583 | 来源:互联网 | 2023-05-16 04:42
源码下载地址:http:www.javaall.comresourcenews.rar我最初写这个程序的目的是为了实现新闻系统的无限级可分类实际无论是新闻也好,
源码下载地址: http://www.javaall.com/resource/news.rar
我最初写这个程序的目的是为了实现新闻系统的无限级可分类
实际无论是新闻也好,产品也好,都可以利用该分类程序.
这是值传递对象的实现类:
说明: 默认属性是根节点ROOT 的属性
package com.news.entity;
public class NewsClass {
protected Integer classID = new Integer("0");
protected String className = "root";
protected Integer parentID = new Integer("-1");
protected Integer orderID = new Integer("0");
protected Integer depth = new Integer("-1");
protected String path = "";
protected String printChar="";
protected Integer child = new Integer("0");
protected boolean canAdd= false;
protected String cUrl = "";
protected Integer cTempid = new Integer("0");
protected Integer pageSize = new Integer("0");
protected boolean cInNav = false;
protected String display = "";
protected String listDisplay = "";
public String getListDisplay() {
return listDisplay;
}
public void setListDisplay(int depth) {
String str = "";
for(int i = 0; i str += "" ;
}
this.listDisplay = str;
}
public String getDisplay() {
return display;
}
public void setDisplay(int depth,String className) {
String str="";
for(int i=0;i {
str+= "│";
}
str+= "├";
str+= className;
this.display = str;
}
/**
* @return Returns the depth.
*/
public Integer getDepth() {
return depth;
}
/**
* @param depth The depth to set.
*/
public void setDepth(Integer depth) {
this.depth = depth;
}
/**
* @return Returns the classID.
*/
public Integer getClassID() {
return classID;
}
/**
* @param classID The classID to set.
*/
public void setClassID(Integer classID) {
this.classID = classID;
}
/**
* @return Returns the className.
*/
public String getClassName() {
return className;
}
/**
* @param className The className to set.
*/
public void setClassName(String className) {
this.className = className;
}
/**
* @return Returns the parentID.
*/
public Integer getParentID() {
return parentID;
}
/**
* @param parentID The parentID to set.
*/
public void setParentID(Integer parentID) {
this.parentID = parentID;
}
/**
* @return Returns the orderID.
*/
public Integer getOrderID() {
return orderID;
}
/**
* @param orderID The orderID to set.
*/
public void setOrderID(Integer orderID) {
this.orderID = orderID;
}
/**
* @param path
*/
public void setPath(String path){
this.path = path;
}
/**
*
* @return
*/
public String getPath(){
return path;
}
public void setChild(Integer child)
{
this.child = child;
}
public Integer getChild()
{
return child;
}
public void setCanAdd(boolean canAdd)
{
this.canAdd = canAdd;
}
public boolean getCanAdd()
{
return canAdd;
}
public void setCUrl(String cUrl)
{
this.cUrl = cUrl;
}
public String getCUrl()
{
return cUrl;
}
public void setCtempid (Integer cTempid )
{
this.cTempid = cTempid ;
}
public Integer getCTempid ()
{
return cTempid;
}
public void setPageSize (Integer pageSize )
{
this.pageSize = pageSize ;
}
public Integer getPageSize ()
{
return pageSize;
}
public void setCInNav (boolean cInNav )
{
this.cInNav = cInNav ;
}
public boolean getCInNav ()
{
return cInNav;
}
public void setPrintChar(int depth,int child) {
String str="";
for(int i=0;i {
str+= "│";
}
str+= "├";
this.printChar = str;
}
public String getPrintChar() {
return printChar;
}
public static void main(String[] args) {
}
}