java-items
类名Items
package entity; //商品类
public class Items { private int id; // 商品编号
private String name; // 商品名称
private String city; // 产地
private int price; // 价格
private int number; // 库存
private String picture; // 商品图片 //保留此不带参数的构造方法
public Items()
{ } public Items(int id,String name,String city,int price,int number,String picture)
{
this.id = id;
this.name = name;
this.city = city;
this.picture = picture;
this.price = price;
this.number = number; }
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} public String getCity() {
return city;
} public void setCity(String city) {
this.city = city;
} public int getPrice() {
return price;
} public void setPrice(int price) {
this.price = price;
} public int getNumber() {
return number;
} public void setNumber(int number) {
this.number = number;
} public String getPicture() {
return picture;
} public void setPicture(String picture) {
this.picture = picture;
} @Override
public int hashCode() {
// TODO Auto-generated method stub
return this.getId()+this.getName().hashCode();
} @Override
public boolean equals(Object obj) {
// TODO Auto-generated method stub
if(this==obj)
{
return true;
}
if(obj instanceof Items)
{
Items i = (Items)obj;
if(this.getId()==i.getId()&&this.getName().equals(i.getName()))
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
} public String toString()
{
return "商品编号:"+this.getId()+",商品名称:"+this.getName();
} }
java-items的更多相关文章
- Java基础知识回顾之四 ----- 集合List、Map和Set
前言 在上一篇中回顾了Java的三大特性:封装.继承和多态.本篇则来介绍下集合. 集合介绍 我们在进行Java程序开发的时候,除了最常用的基础数据类型和String对象外,也经常会用到集合相关类. 集 ...
- 使用自定的Adapter绑定ListView/GridView数据
使用自定的Adapter绑定ListView/GridView数据(地址) 对于ListView/Gridview的数据绑定, google提供了一些Adapter的模板, 自己也可以自定义一些个性化 ...
- Python小爬虫练习
# coding: utf-8 __author__ = 'zhangcx' from urllib3 import PoolManager import codecs import json cla ...
- CKeditor插件开发流程(二)SyntaxHighlighter
CKEditor整合SyntaxHighlighter实现代码高亮显示 1,版本说明 CKEditor:ckeditor_4.0.1_standard.zipSyntaxHighlighter:syn ...
- 通过注解实现通用导出Excel
Javaweb开发中数据的导入导出很常见,每次我们都需要写很多代码,所以我就在想能不能写一些通用的方法,之前已经在网上 整理过一些通用的方法,最近在网上看到一位牛人封装的更加简介,自己拿过来整理了一下 ...
- Spark案例分析
一.需求:计算网页访问量前三名 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /* ...
- java.lang.IllegalArgumentException: Attribute 'items' is required and must be a Collection, an Array or a Map
很有可能是涉及items的时候写成了item导致此错
- [java][转]安装ADT的时候,提示“Cannot complete the install because one or more required items could not be
今天在安装ADT的时候,提示“Cannot complete the install because one or more required items could not be found. S ...
- 小兔Java教程 - 三分钟学会Java文件上传
今天群里正好有人问起了Java文件上传的事情,本来这是Java里面的知识点,而我目前最主要的精力还是放在了JS的部分.不过反正也不麻烦,我就专门开一贴来聊聊Java文件上传的基本实现方法吧. 话不多说 ...
- java 线程 Lock 锁使用Condition实现线程的等待(await)与通知(signal)
一.Condition 类 在前面我们学习与synchronized锁配合的线程等待(Object.wait)与线程通知(Object.notify),那么对于JDK1.5 的 java.util.c ...
随机推荐
- IPv6时代已来:双十一中的IPv6大规模应用实践
摘要: 刚刚过去的双十一,大家对猫晚.抢红包.组团购还记忆犹新.大家不了解的是,不知不觉间,你可能已经成为首批互联网IPv6用户了.今年天猫双十一期间,阿里巴巴全面支持了IPv6,这是IPv6在我国的 ...
- webpack 兼容低版本浏览器,转换ES6 ES7语法
ES6,ES7真的太棒了,async +await+Promise,让我阅读代码的时候不用再从左拉到右了(异步太多,一层套一层真的太头痛) 但是有个问题,打包后低版本浏览器运行不了,还有我用了一些混淆 ...
- bzoj 3881 [Coci2015]Divljak——LCT维护parent树链并
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3881 对 S 建 SAM ,每个 T 会让 S 的 parent 树的链并答案+1:在 T ...
- 探索Redis设计与实现1:Redis 的基础数据结构概览
本文转自互联网 本系列文章将整理到我在GitHub上的<Java面试指南>仓库,更多精彩内容请到我的仓库里查看 https://github.com/h2pl/Java-Tutorial ...
- spring相关注解
spring相关注解: 使用之前需要<context:annotation-config/>在配置文件中启用 @Required 应用于类属性的set方法,并且要求该属性必须在xml容器里 ...
- PHP面试 MySQL创建高性能索引考点
MySQL索引 MySQL索引的基础和类型 索引的基础:索引类似于书籍的目录,要想找到一本书的某个特定篇章,需要查找书的目录,定位对应的页码 存储引擎使用类似的方式进行数据查询,先去索引当中找到对应的 ...
- WebBrowser是IE内置的浏览器控件
WebBrowser是IE内置的浏览器控件.WebBrowser是IE内置的浏览器控件.WebBrowser是IE内置的浏览器控件.重要的事情说三遍,原因是一开始使用的时候就在这踩了坑. WebBro ...
- MySQL高级学习笔记(一):mysql简介、mysq linux版的安装(mysql 5.5)
文章目录 MySQL简介 概述 mysql高手是怎样炼成的 mysq linux版的安装(mysql 5.5) 下载地址 拷贝&解压缩 检查工作 检查当前系统是否安装过mysql 检查/tmp ...
- http相应状态码大全
100 Continue 初始的请求已经接受,客户应当继续发送请求的其余部分 101 Switching Protocols 服务器将遵从客户的请求转换到另外一种协议 200 OK 一切正常,对GET ...
- 2019ccpc网络赛hdu6705 path
path 题目传送门 解题思路 先用vector存图,然后将每个vector按照边的权值从小到大排序.将每个顶点作为起点的边里最短的边存入优先队列.对于存入优先队列的信息,应有边起点,终点,是其起点的 ...