ParserUtil.java
980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcom.util;
/**
*
* @author gcom
*/
public class ParserUtil {
private int contador = 0;
private String fonte;
/**
*
* @param fonte
*/
public ParserUtil(String fonte) {
this.fonte = fonte;
}
public String obterDadoParserTrim(int tamanho) {
return obterDadoParser(tamanho).trim();
}
/**
*
* @param tamanho
* @return
*/
public String obterDadoParser(int tamanho) {
int posicaoInicial = contador;
contador += tamanho;
return fonte.substring(posicaoInicial, contador);
}
/**
*
* @return
*/
public String getFonte() {
return fonte;
}
/**
*
* @param fonte
*/
public void setFonte(String fonte) {
this.fonte = fonte;
}
/**
*
* @return
*/
public int getContador() {
return contador;
}
/**
*
* @param contador
*/
public void setContador(int contador) {
this.contador = contador;
}
}