Baixe o app para aproveitar ainda mais
Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
Questao 01/build/built-jar.properties #Tue, 28 Apr 2020 19:38:42 -0300 C\:\\Users\\laelk\\Documents\\NetBeansProjects\\Questao\ 01= Questao 01/build/classes/.netbeans_automatic_build Questao 01/build/classes/.netbeans_update_resources Questao 01/build/classes/br/edu/fafic/provaES/abstrat/Plug.class package br.edu.fafic.provaES.abstrat; public abstract synchronized class Plug { public void Plug(); public abstract String obtemConexao(); } Questao 01/build/classes/br/edu/fafic/provaES/abstrat/Vitrola.class package br.edu.fafic.provaES.abstrat; public abstract synchronized class Vitrola { public void Vitrola(); public abstract String conecta(Object); public abstract String getNomeTipo(); } Questao 01/build/classes/br/edu/fafic/provaES/classes/AdaptadorCDparaVitrola.class package br.edu.fafic.provaES.classes; public synchronized class AdaptadorCDparaVitrola extends EntradaVitrola { public void AdaptadorCDparaVitrola(); public String conecta(PlugCD); } Questao 01/build/classes/br/edu/fafic/provaES/classes/EntradaCD.class package br.edu.fafic.provaES.classes; public synchronized class EntradaCD extends br.edu.fafic.provaES.abstrat.Vitrola { public void EntradaCD(); public String conecta(PlugCD); public String getNomeTipo(); } Questao 01/build/classes/br/edu/fafic/provaES/classes/EntradaVitrola.class package br.edu.fafic.provaES.classes; public synchronized class EntradaVitrola extends br.edu.fafic.provaES.abstrat.Vitrola { public void EntradaVitrola(); public String conecta(PlugVitrola); public String getNomeTipo(); } Questao 01/build/classes/br/edu/fafic/provaES/classes/PlugCD.class package br.edu.fafic.provaES.classes; public synchronized class PlugCD extends br.edu.fafic.provaES.abstrat.Plug { public void PlugCD(); public String obtemConexao(); } Questao 01/build/classes/br/edu/fafic/provaES/classes/PlugVitrola.class package br.edu.fafic.provaES.classes; public synchronized class PlugVitrola extends br.edu.fafic.provaES.abstrat.Plug { public void PlugVitrola(); public String obtemConexao(); } Questao 01/build/classes/br/edu/fafic/provaES/main/main.class package br.edu.fafic.provaES.main; public synchronized class main { public void main(); public static void main(String[]); } Questao 01/build.xml Builds, tests, and runs the project Questao 01. Questao 01/dist/Questao_01.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.7 Created-By: 1.8.0_111-b14 (Oracle Corporation) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: br.edu.fafic.provaES.main.main br/edu/fafic/provaES/abstrat/Plug.class package br.edu.fafic.provaES.abstrat; public abstract synchronized class Plug { public void Plug(); public abstract String obtemConexao(); } br/edu/fafic/provaES/abstrat/Vitrola.class package br.edu.fafic.provaES.abstrat; public abstract synchronized class Vitrola { public void Vitrola(); public abstract String conecta(Object); public abstract String getNomeTipo(); } br/edu/fafic/provaES/classes/AdaptadorCDparaVitrola.class package br.edu.fafic.provaES.classes; public synchronized class AdaptadorCDparaVitrola extends EntradaVitrola { public void AdaptadorCDparaVitrola(); public String conecta(PlugCD); } br/edu/fafic/provaES/classes/EntradaCD.class package br.edu.fafic.provaES.classes; public synchronized class EntradaCD extends br.edu.fafic.provaES.abstrat.Vitrola { public void EntradaCD(); public String conecta(PlugCD); public String getNomeTipo(); } br/edu/fafic/provaES/classes/EntradaVitrola.class package br.edu.fafic.provaES.classes; public synchronized class EntradaVitrola extends br.edu.fafic.provaES.abstrat.Vitrola { public void EntradaVitrola(); public String conecta(PlugVitrola); public String getNomeTipo(); } br/edu/fafic/provaES/classes/PlugCD.class package br.edu.fafic.provaES.classes; public synchronized class PlugCD extends br.edu.fafic.provaES.abstrat.Plug { public void PlugCD(); public String obtemConexao(); } br/edu/fafic/provaES/classes/PlugVitrola.class package br.edu.fafic.provaES.classes; public synchronized class PlugVitrola extends br.edu.fafic.provaES.abstrat.Plug { public void PlugVitrola(); public String obtemConexao(); } br/edu/fafic/provaES/main/main.class package br.edu.fafic.provaES.main; public synchronized class main { public void main(); public static void main(String[]); } Questao 01/dist/README.TXT ======================== BUILD OUTPUT DESCRIPTION ======================== When you build an Java application project that has a main class, the IDE automatically copies all of the JAR files on the projects classpath to your projects dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR files manifest file (MANIFEST.MF). To run the project from the command line, go to the dist folder and type the following: java -jar "Questao_01.jar" To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file. Notes: * If two JAR files on the project classpath have the same name, only the first JAR file is copied to the lib folder. * Only JAR files are copied to the lib folder. If the classpath contains other types of files or folders, these files (folders) are not copied. * If a library on the projects classpath also has a Class-Path element specified in the manifest,the content of the Class-Path element has to be on the projects runtime path. * To set a main class in a standard Java project, right-click the project node in the Projects window and choose Properties. Then click Run and enter the class name in the Main Class field. Alternatively, you can manually type the class name in the manifest Main-Class element. Questao 01/manifest.mf Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Questao 01/nbproject/build-impl.xml Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url Questao 01/nbproject/genfiles.properties build.xml.data.CRC32=929b36aa build.xml.script.CRC32=a57b75ba build.xml.stylesheet.CRC32=8064a381@1.80.1.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=929b36aa nbproject/build-impl.xml.script.CRC32=312b13ef nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 Questao 01/nbproject/private/private.properties compile.on.save=true user.properties.file=C:\\Users\\laelk\\AppData\\Roaming\\NetBeans\\8.2\\build.properties Questao 01/nbproject/private/private.xml file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/classes/EntradaCD.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/abstrat/Vitrola.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/classes/AdaptadorCDparaVitrola.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/classes/PlugCD.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/main/main.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/abstrat/Plug.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/classes/EntradaVitrola.java file:/C:/Users/laelk/Documents/NetBeansProjects/Questao%2001/src/br/edu/fafic/provaES/classes/PlugVitrola.java Questao 01/nbproject/project.properties annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/Questao_01.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=br.edu.fafic.provaES.main.main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test Questao 01/nbproject/project.xml org.netbeans.modules.java.j2seproject Questao 01 Questao 01/src/br/edu/fafic/provaES/abstrat/Plug.java Questao 01/src/br/edu/fafic/provaES/abstrat/Plug.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.abstrat; /** * * @author laelk */ public abstract class Plug { public abstract String obtemConexao(); } Questao 01/src/br/edu/fafic/provaES/abstrat/Vitrola.java Questao 01/src/br/edu/fafic/provaES/abstrat/Vitrola.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.abstrat; /** * * @author laelk * @param <P> */ public abstract class Vitrola <P>{ public abstract String conecta (P plug); public abstract String getNomeTipo(); } Questao 01/src/br/edu/fafic/provaES/classes/AdaptadorCDparaVitrola.java Questao 01/src/br/edu/fafic/provaES/classes/AdaptadorCDparaVitrola.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; /** * * @author laelk */ public class AdaptadorCDparaVitrola extends EntradaVitrola{ public String conecta(PlugCD plugCD){ return plugCD.obtemConexao() + getNomeTipo(); } } Questao 01/src/br/edu/fafic/provaES/classes/EntradaCD.java Questao 01/src/br/edu/fafic/provaES/classes/EntradaCD.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import br.edu.fafic.provaES.abstrat.Vitrola; /** * * @author laelk */ public class EntradaCD extends Vitrola<PlugCD>{ @Override public String conecta(PlugCD plug) { return plug.obtemConexao() + getNomeTipo(); } @Override public String getNomeTipo() { return "Plug CD"; } } Questao 01/src/br/edu/fafic/provaES/classes/EntradaVitrola.java Questao 01/src/br/edu/fafic/provaES/classes/EntradaVitrola.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import br.edu.fafic.provaES.abstrat.Vitrola; /** * * @author laelk */ public class EntradaVitrola extends Vitrola<PlugVitrola>{ @Override public String conecta(PlugVitrola plug) { return plug.obtemConexao() + getNomeTipo(); } @Override public String getNomeTipo() { return "Plug VITROLA"; } } Questao 01/src/br/edu/fafic/provaES/classes/PlugCD.java Questao 01/src/br/edu/fafic/provaES/classes/PlugCD.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import br.edu.fafic.provaES.abstrat.Plug; /** * * @author laelk */ public class PlugCD extends Plug{ @Override public String obtemConexao() { return "Plug CD conectado à "; } } Questao 01/src/br/edu/fafic/provaES/classes/PlugVitrola.java Questao 01/src/br/edu/fafic/provaES/classes/PlugVitrola.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import br.edu.fafic.provaES.abstrat.Plug; /** * * @author laelk */ public class PlugVitrola extends Plug{ @Override public String obtemConexao() { return "Plug VITROLA conectado à "; } } Questao 01/src/br/edu/fafic/provaES/main/main.java Questao 01/src/br/edu/fafic/provaES/main/main.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.main; import br.edu.fafic.provaES.classes.AdaptadorCDparaVitrola; import br.edu.fafic.provaES.classes.EntradaCD; import br.edu.fafic.provaES.classes.PlugCD; import br.edu.fafic.provaES.classes.PlugVitrola; /** * * @author laelk */ public class main { /** * @param args the command line arguments */ public static void main(String[] args) { EntradaCD entradaCD = new EntradaCD(); //PlugVitrola plugVitrola = new PlugVitrola(); PlugCD plugCD = new PlugCD(); AdaptadorCDparaVitrola adaptador = new AdaptadorCDparaVitrola(); System.out.println(adaptador.conecta(plugCD)); } } Questao 03/build/classes/.netbeans_automatic_build Questao 03/build/classes/.netbeans_update_resources Questao 03/build/classes/br/edu/fafic/provaES/classes/Automovel.class package br.edu.fafic.provaES.classes; public synchronized class Automovel { private String marca; private String modelo; private Boolean arCond; private Boolean airBarg; private Boolean multimidia; public void Automovel(String, String, Boolean, Boolean, Boolean); public String getMarca(); public void setMarca(String); public String getModelo(); public void setModelo(String); public Boolean getArCond(); public void setArCond(Boolean); public Boolean getAirBarg(); public void setAirBarg(Boolean); public Boolean getMultimidia(); public void setMultimidia(Boolean); public String toString(); } Questao 03/build/classes/br/edu/fafic/provaES/classes/AutomovelBuilder.class package br.edu.fafic.provaES.classes; public synchronized class AutomovelBuilder implements br.edu.fafic.provaES.interfac.Builder { private final String marca; private final String modelo; private boolean arCond; private boolean airBarg; private boolean multimidia; public void AutomovelBuilder(String, String); public AutomovelBuilder arCond(); public AutomovelBuilder airBarg(); public AutomovelBuilder multimidia(); public Automovel create(); } Questao 03/build/classes/br/edu/fafic/provaES/interfac/Builder.class package br.edu.fafic.provaES.interfac; public abstract interface Builder { public abstract Object arCond(); public abstract Object airBarg(); public abstract Object multimidia(); public abstract Object create(); } Questao 03/build/classes/br/edu/fafic/provaES/main/main.class package br.edu.fafic.provaES.main; public synchronized class main { public void main(); public static void main(String[]); } Questao 03/build.xml Builds, tests, and runs the project Questao 03. Questao 03/manifest.mf Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build Questao 03/nbproject/build-impl.xml Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url Questao 03/nbproject/genfiles.properties build.xml.data.CRC32=82bc2ee6 build.xml.script.CRC32=f90d8814 build.xml.stylesheet.CRC32=8064a381@1.80.1.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=82bc2ee6 nbproject/build-impl.xml.script.CRC32=157fda6f nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 Questao 03/nbproject/private/private.properties compile.on.save=true user.properties.file=C:\\Users\\laelk\\AppData\\Roaming\\NetBeans\\8.2\\build.properties Questao 03/nbproject/project.properties annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/Questao_03.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=br.edu.fafic.provaES.main.main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test Questao 03/nbproject/project.xml org.netbeans.modules.java.j2seproject Questao 03 Questao 03/src/br/edu/fafic/provaES/classes/Automovel.java Questao 03/src/br/edu/fafic/provaES/classes/Automovel.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import java.util.List; /** * * @author laelk */ public class Automovel { private String marca; private String modelo; private Boolean arCond; private Boolean airBarg; private Boolean multimidia; public Automovel(String marca, String modelo, Boolean arCond, Boolean airBarg, Boolean multimidia) { this.marca = marca; this.modelo = modelo; this.arCond = arCond; this.airBarg = airBarg; this.multimidia = multimidia; } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } public Boolean getArCond() { return arCond; } public void setArCond(Boolean arCond) { this.arCond = arCond; } public Boolean getAirBarg() { return airBarg; } public void setAirBarg(Boolean airBarg) { this.airBarg = airBarg; } public Boolean getMultimidia() { return multimidia; } public void setMultimidia(Boolean multimidia) { this.multimidia = multimidia; } @Override public String toString() { return "*****Automovel*****" +"\n" + "Marca: " + marca +"\n" + "Modelo: " + modelo +"\n" + "*****Componentes*****" +"\n" + "ArCondicionado: " + arCond +"\n" + "AirBarg: " + airBarg +"\n" + "Multimidia: " + multimidia; } } Questao 03/src/br/edu/fafic/provaES/classes/AutomovelBuilder.java Questao 03/src/br/edu/fafic/provaES/classes/AutomovelBuilder.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.classes; import br.edu.fafic.provaES.interfac.Builder; /** * * @author laelk */ public class AutomovelBuilder implements Builder<AutomovelBuilder, Automovel> { private final String marca; private final String modelo; private boolean arCond; private boolean airBarg; private boolean multimidia; public AutomovelBuilder(String marca, String modelo) { this.marca = marca; this.modelo = modelo; } @Override public AutomovelBuilder arCond() { this.arCond = true; return this; } @Override public AutomovelBuilder airBarg() { this.airBarg = true; return this; } @Override public AutomovelBuilder multimidia() { this.multimidia = true; return this; } @Override public Automovel create() { return new Automovel(marca, modelo, arCond, airBarg, multimidia); } } Questao 03/src/br/edu/fafic/provaES/interfac/Builder.java Questao 03/src/br/edu/fafic/provaES/interfac/Builder.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.interfac; /** * * @author laelk */ public interface Builder<K, T> { public K arCond(); public K airBarg(); public K multimidia(); public T create(); } Questao 03/src/br/edu/fafic/provaES/main/main.java Questao 03/src/br/edu/fafic/provaES/main/main.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.edu.fafic.provaES.main; import br.edu.fafic.provaES.classes.AutomovelBuilder; /** * * @author laelk */ public class main { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println(new AutomovelBuilder("Chevrolet", "Onix").create()); System.out.println("-------------------------------------------------"); System.out.println(new AutomovelBuilder("Chevrolet", "Onix").airBarg().create()); System.out.println("-------------------------------------------------"); System.out.println(new AutomovelBuilder("Chevrolet", "Onix").airBarg().arCond().create()); System.out.println("-------------------------------------------------"); System.out.println(new AutomovelBuilder("Chevrolet", "Onix").airBarg().arCond().multimidia().create()); } }
Compartilhar