(原创)无限级可分类的分类表ADT的实现(2)

该博客提供了新闻系统无限级分类程序的源码下载地址,介绍此程序可用于新闻、产品等分类。还给出了值传递对象的实现类 NewsClass,包含多个属性及对应的 get、set 方法,如 classID、className 等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

   源码下载地址: 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<depth;i++){
  str += "<img src=images/admin_tree_line.gif border=0>" ;
  }
  this.listDisplay = str;
 }

 public String getDisplay() {
  return display;
 }
 
 public void setDisplay(int depth,String className) {
  String str="";
  for(int i=0;i<depth;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<depth;i++)
  {
     str+= "│";
  }
  
     str+= "├";
  
  this.printChar = str;
    }
 public String getPrintChar() {
      
  return printChar;
    }
 public static void main(String[] args) {
 }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值