Skip to content
Snippets Groups Projects
Commit 16404877 authored by Bergony 's avatar Bergony
Browse files

Projeto add Class criadas

parent c50617c0
No related branches found
No related tags found
No related merge requests found
.project 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>FakeNews</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
source diff could not be displayed: it is too large. Options to address this: view the blob.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>FakeNews</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
/br/
<?xml version="1.0" encoding="ASCII"?>
<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
<deploy>
<application name="FakeNews"/>
<info/>
</deploy>
<signjar/>
</anttasks:AntTask>
package br.ufrn.imd.controle;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class ControladorArquivo {
private String arquivo = "C:\\Users\\Bergony\\Desktop\\FAKE\\FakeNews\\Docs\\boatos.csv";
private BufferedReader buffer = null;
private FileReader in;
public ControladorArquivo(){
}
public void abrirArquivo() throws arquivoException {
try {
in = new FileReader(arquivo);
} catch (FileNotFoundException e) {
throw new arquivoException(e);
}
}
public int dataSetSize() throws IOException {
int count = 0;
String out;
setBuffer(new BufferedReader(in));
while((out = buffer.readLine()) != null)
{
count++;
}
buffer.close();
return count;
}
public String lerLinha(int linha) throws IOException {
int count = 0;
setBuffer(new BufferedReader(in));
String out = buffer.readLine();
while(count <= linha)
{
System.out.println(out);
if((out = buffer.readLine()) == null)
{
throw new arquivoException("ID Fora do DataSet");
}
count++;
}
return out;
}
public String getArquivo() {
return arquivo;
}
public void setArquivo(String arquivo) {
this.arquivo = arquivo;
}
public BufferedReader getBuffer() {
return buffer;
}
public void setBuffer(BufferedReader buffer) {
this.buffer = buffer;
}
public FileReader getIn() {
return in;
}
public void setIn(FileReader in) {
this.in = in;
}
}
package br.ufrn.imd.controle;
import java.io.FileNotFoundException;
public class arquivoException extends FileNotFoundException {
/**
*
*/
private static final long serialVersionUID = 1L;
public arquivoException(Exception e) {
super(e.getMessage());
// TODO Auto-generated constructor stub
}
public arquivoException(String e) {
super(e);
// TODO Auto-generated constructor stub
}
}
package br.ufrn.imd.visao;
import java.io.IOException;
import br.ufrn.imd.controle.ControladorArquivo;
public class Principal {
public static void main(String[] args) throws IOException {
System.out.println("Out");
ControladorArquivo ca = new ControladorArquivo();
ca.abrirArquivo();
int out1 = ca.dataSetSize();
System.out.println("Saida "+ out1);
System.out.println("Saida "+ ca.lerLinha(10));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment