热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

源码下载地址: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) {
 }
}

 


推荐阅读
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 本文详细介绍了GetModuleFileName函数的用法,该函数可以用于获取当前模块所在的路径,方便进行文件操作和读取配置信息。文章通过示例代码和详细的解释,帮助读者理解和使用该函数。同时,还提供了相关的API函数声明和说明。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • SpringBoot uri统一权限管理的实现方法及步骤详解
    本文详细介绍了SpringBoot中实现uri统一权限管理的方法,包括表结构定义、自动统计URI并自动删除脏数据、程序启动加载等步骤。通过该方法可以提高系统的安全性,实现对系统任意接口的权限拦截验证。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 本文介绍了使用Java实现大数乘法的分治算法,包括输入数据的处理、普通大数乘法的结果和Karatsuba大数乘法的结果。通过改变long类型可以适应不同范围的大数乘法计算。 ... [详细]
  • 本文介绍了如何在给定的有序字符序列中插入新字符,并保持序列的有序性。通过示例代码演示了插入过程,以及插入后的字符序列。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
  • C# 7.0 新特性:基于Tuple的“多”返回值方法
    本文介绍了C# 7.0中基于Tuple的“多”返回值方法的使用。通过对C# 6.0及更早版本的做法进行回顾,提出了问题:如何使一个方法可返回多个返回值。然后详细介绍了C# 7.0中使用Tuple的写法,并给出了示例代码。最后,总结了该新特性的优点。 ... [详细]
  • 本文介绍了为什么要使用多进程处理TCP服务端,多进程的好处包括可靠性高和处理大量数据时速度快。然而,多进程不能共享进程空间,因此有一些变量不能共享。文章还提供了使用多进程实现TCP服务端的代码,并对代码进行了详细注释。 ... [详细]
  • 本文介绍了Java高并发程序设计中线程安全的概念与synchronized关键字的使用。通过一个计数器的例子,演示了多线程同时对变量进行累加操作时可能出现的问题。最终值会小于预期的原因是因为两个线程同时对变量进行写入时,其中一个线程的结果会覆盖另一个线程的结果。为了解决这个问题,可以使用synchronized关键字来保证线程安全。 ... [详细]
author-avatar
郑郑郑克_583
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有