0
What would be the function of ListIterator
? I have a variable of type List
, that receives the information from my Postgresql Database, I need to access the information of this type variable List
but when using the method get()
To select the information of a given Index I am having as return the reference of this record and not its information. With the listIterator I can access the information of my variable of type List?
def i = 0;
def x = 0;
def z = transportadorasBanco.size();
def y = listaTransportadoras.size();
logger.info("Registros BDM: "+ z)
logger.info("Registros Banco de Dados PostgreSQL: "+ y)
def itemBDM = []
def itemPost = []
while (x <= (z - 1)){
while (i <= (y - 1)){
if (transportadorasBanco.get(x).toString().equals(listaTransportadoras.get(i).toString())){
logger.info("POSSICAO BDM: " +x)
logger.info("POSSICAO POSTGRESQL: " +i)
logger.info("IGUAIS")
logger.info(transportadorasBanco.get(x).toString())
logger.info(listaTransportadoras.get(i).toString())
logger.info("")
}
else {
logger.info("POSSICAO BDM: " +x)
logger.info("POSSICAO POSTGRESQL: " +i)
logger.info("DIFERENTES")
logger.info(transportadorasBanco.get(x).toString())
logger.info(listaTransportadoras.get(i).toString())
logger.info("")
}
i++;
}
x++;
i = 0;
}
This one of yours
List
is integer?– Felipe Marinho
Has the integer numbers and strings
– R.Santos
You can give a code example of your method
get
not returning the information you want?– Felipe Marinho
I edited my question, with the script in groovy where I try to access the variable information
– R.Santos
The lists
transportadorasBanco
andlistaTransportadoras
are lists of which?– Felipe Marinho
I am programming in a program to develop BPM to develop processes, in this tool has the BDM (Business Data Model), a business database, then the variable
transportadorasBanco
receives BDM values and variablelistaTransportadoras
receives the information from Postgresql– R.Santos
But you could tell me at least the function of
ListIterator
?– R.Santos
A
ListIterator
is aIterator
list-specific. In addition to the methods he inherits from aIterator
, it has methods that allow you to scroll through the list in both directions and modify the list during iteration.– Felipe Marinho
And I get through
ListIterator
compare information from my list, for example take out the repeated codes?– R.Santos
Let’s go continue this discussion in chat.
– Felipe Marinho