download:畅销3年的Python分布式爬虫课程 Scrapy打造搜索引擎
未来是什么时代?是数据时代!数据分析服务、互联网金融,数据建模、自然语言处理、医疗病例分析……越来越多的工作会基于数据来做,而爬虫正是快速获取数据最重要的方式,相比其它语言,Python爬虫更简单、高效
适合人群
适合对爬虫感兴趣、想做大数据开发却找不到数据
又不知如何搭建一套稳定可靠的分布式爬虫的同学
想搭建搜索引擎但是不知道如何入手的同学
技术储备要求
具备一定的原生爬虫基础
了解前端页面,面向对象概念,计算机网络协议和数据库知识
package com.kukudeyu.hotelsystem;
public class Room {
private int id; //房间编号
private String type; //房间类型
private boolean status; //房间状态:true表示闲暇,false表示占用
public Room() {
}
public Room(int id, String type, boolean status) {
this.id = id;
this.type = type;
this.status = status;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public boolean getStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
/*
- 重写toString办法
- 打印出房间详情信息,其中包括房间编号,类型,状态
- */br/>@Override
public String toString() {
return "[" + this.id + "," + this.type + "," + (this.status ? "闲暇":"占用" ) + "]";
}
// 依照惯例,重写equals办法,作用为判别两个房间能否为一个房间br/>@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof Room)) return false;
Room room = (Room)o;
if(this.id == room.id){
return true;
}
return false;
}
}
Hotel类(酒店类)
[
package com.kukudeyu.hotelsystem;
public class Hotel {
private Room[][] rooms; //应用二维数组创立酒店房间数组
/
应用结构办法来停止酒店房间布置操作
应用数组遍历,创立酒店房间对象放进酒店房间数组里
其中,
一层为单人世,二层为双人世,三层为总统套房
/
public Hotel() {
rooms = new Room[3][10];
for (int i = 0; i < rooms.length; i++) {
for (int j = 0; j < rooms[i].length; j++) {
if (i == 0) {
rooms[i][j] = new Room((i + 1)
100 + j + 1, "单人世", true);
} else if (i == 1) {
rooms[i][j] = new Room((i + 1)
100 + j + 1, "双人世", true);
} else if (i == 2) {
rooms[i][j] = new Room((i + 1)
100 + j + 1, "总统套房", true);
}
}
}
}
/
](mailto:br/%3E@Override%3Cbr/)