Processing stream and modifier mode, decoration Mode

Source: Internet
Author: User

Processing stream and modifier mode, decoration Mode

Stream processing instance: BufferedReader character input stream processing

The BufferedReader class has a method called readLine (), which reads a row of data and returns this row of data.

Method for generating BufferedReader object:

BufferedReader br = new BufferedReader (new FileReader ("C :\"))

import java.io.*;class Test{public static void main(String args[]){FileReader fr = null;BufferedReader br =null;try{fr = new FileReader("F:/Android/Java4Android/34/src/users.txt");br = new BufferedReader(fr);String s = br.readLine();System.out.println(s);}catch(Exception e){System.out.println(e);}finally{try{fr.close();br.close();}catch(Exception e){System.out.println(e);}}}}

 

Decorator mode example:

interface Worker{public void doSomeWork();}
Class Carpenter implements Worker {public void doSomeWork () {System. out. println ("repair doors and windows ");}}
Class Plumber implements Worker {public void doSomeWork () {System. out. println ("Water Pipe repairing ");}}
Class Aworker implements Worker {private Worker worker; public Aworker (Worker aworker) {this. worker = aworker;} public void doSomeWork () {System. out. println ("hello"); worker. doSomeWork ();}}
class Test{public static void main(String args[]){Worker carpenter = new Carpenter();Aworker carpenterWorker = new Aworker(carpenter);carpenterWorker.doSomeWork();Worker plumber = new Plumber();Aworker plumberWorker = new Aworker(plumber);plumberWorker.doSomeWork();}}

  

 


What are the operation procedures and precautions of the decoration company?

Clever arrangement of the decoration process --- Qingdao Group X gives you a detailed description, hoping to help you

According to a survey conducted by X Group, decoration for many cainiao is a mental, physical, and patient process, but don't worry, as long as you arrange your time and energy properly, you will get twice the result with half the effort. If you do not have any decoration experience, please join in group x to hear our suggestions.

Two to three months before the House was ready, the owners had to start putting the decoration on the agenda. First of all, make up the basic decoration knowledge. The information in modern society is developed. You can learn more about the information on the Internet, read newspapers and magazines in related topics, consult with relatives and friends who have experience in decoration, or visit a house that has just been renovated by others, feel the decoration style you want. Friends usually tell you all about experience, lessons, and regrets, which greatly reduces the probability of making mistakes. (Provided by X mission Qingdao Station)

Select company and Mode

After you finish this work, you can switch to the decoration companies in various major stores. First, you can communicate with the designers and have a simple understanding of the decoration. Generally, the decoration period is about 45-50 days. You can also learn about several popular decoration modes. There are three methods for decoration: cleaning, half-outsourcing, and full-outsourcing.

Contractor clearance means you have to purchase all the materials yourself, including cement mortar, floor and floor tiles, and water and electricity pipes. The construction party is only responsible for construction. Currently, it is very rare on the market, only a small number of guerrillas are allowed to perform such activities.

Half-outsourcing can be called the traditional decoration mode. Most home decoration companies and guerrillas can provide such services. If you choose this method, you need to purchase the main materials such as floor tiles and sanitary ware. The decoration company or the guerrillas provide cement, mortar and other auxiliary materials and construction. However, because you need to purchase some materials by yourself, you need to coordinate with all Parties. When the workers require materials to enter the site, you have to contact the relevant manufacturer for delivery to the site, otherwise it is easy to delay the construction period. In addition, you have to familiarize yourself with the entire building materials procurement schedule. For example, before the preliminary cabinet transformation, you need to set a cabinet manufacturer for preliminary measurement, determine the Cabinet location, usage, electrical appliance and water circuit location. (Provided by X mission Qingdao Station)

All-Inclusive refers to all the materials and construction methods provided by the decoration company. Many decoration companies have launched decoration packages, menus, and so on for this type of decoration, you can select the appropriate company and package grade based on your needs. This mode is relatively time-saving, labor-saving, and worry-free, with clear responsibilities and rights. If you do not know anything about decoration and do not have the time and energy to buy materials by yourself, you can consider this method. If you have the necessary conditions, you can select a supervision company to check your account.

Since the guerrillas do not have after-sales service assurance and there may be many quality problems in the future, we recommend that you select a brand decoration company.

Communication and discussion plan

After the decoration company is selected, it enters the stage of communication with the designer. You need to provide the designer with a floor plan for your house, and tell him your preferences (such as red or a piece of furniture), requirements (a study or bar is required), and a budget estimate. (Provided by X mission Qingdao Station)

Once the initial communication is successful, the designer will go to your house and give you a detailed design plan. Then we enter the specific solution discussion stage. At this time, the designer will provide you with design drawings, details of how to deal with, the total cost and so on. In this process, you need to grasp a decoration budget plan that you can afford. Generally, 90 m² of the two homes, medium-grade decoration costs, including main materials, construction, and furniture and electrical appliances, are about 50 thousand yuan. Only by yourself can you control the entire decoration process, so that you will not be confused.

After both parties reach a unified agreement, you can sign the contract. When signing a contract, you need to clarify the responsibility. Then, go to the property company to complete all the necessary procedures for decoration, and then test the kitchen and bathroom, in order to divide the responsibility of developers and decoration companies. The designer, supervisor, foreman, related technical workers, and the owner will come to the house site to provide on-site disclosure and explain the design and construction parts. The key is handed over to the construction unit, and the worker enters the site. On that day, you must clearly express your wishes so that the construction personnel can fully understand your intentions. Otherwise, rework and delay will occur after an error occurs in the future. (Provided by X mission Qingdao Station)

Construction

Construction mainly involves four types of work: woodworking, bricklayer, oil & gas, and plumber. Even if you choose a brand decoration company, you don't have to worry too much about the construction, but you still need to worry more about your love nest. Pay attention to some practices... the remaining full text>

What design philosophy does classes in java I/O packages reflect?

The design idea is of course an object-oriented idea.
The decoration mode and adapter mode are used to describe the design mode,
1. decorator mode: in the hierarchical structure represented by InputStream, OutputStream, Reader, and Writer, some stream processors can play a decorative role on other stream processors to form a new one, stream processor with improved features. The modifier mode is the overall design mode of the Java I/O library. Such a principle is in line with the modifier mode.
2. Adapter mode: some stream processors adapt to other types of processors in the hierarchical structure represented by InputStream, OutputStream, Reader, and Writer. This is the application of the adapter mode.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.