Project

General

Profile

« Previous | Next » 

Revision 42939

implemented alternative for IterablePair

View differences:

modules/dnet-openaire-domain/trunk/src/main/java/eu/dnetlib/data/transform/xml/AbstractDNetXsltFunctions.java
51 51
import eu.dnetlib.data.proto.ResultResultProtos.ResultResult.Supplement;
52 52
import eu.dnetlib.data.proto.TypeProtos.Type;
53 53

  
54
import eu.dnetlib.miscutils.collections.Pair;
54 55
import org.apache.commons.codec.binary.Base64;
55 56
import org.apache.commons.codec.binary.Hex;
56 57
import org.apache.commons.lang3.StringUtils;
57 58
import org.apache.commons.lang3.math.NumberUtils;
58
import org.apache.commons.lang3.tuple.Pair;
59 59
import org.w3c.dom.*;
60 60

  
61 61
public abstract class AbstractDNetXsltFunctions {
......
1511 1511
				return new Iterator<Pair>() {
1512 1512
					@Override
1513 1513
					public boolean hasNext() {
1514
						return fields.hasNext();
1514
						return fields.hasNext() && values.hasNext();
1515 1515
					}
1516 1516

  
1517 1517
					@Override
1518 1518
					public Pair next() {
1519 1519
						final FieldDescriptor field = fields.next();
1520 1520
						final String value = values.next();
1521
						return new Pair() {
1522
							@Override
1523
							public Object setValue(final Object value) {
1524
								throw new UnsupportedOperationException("Cannot set value in iterable pair");
1525
							}
1521
						return new Pair(field, value);
1522
					}
1526 1523

  
1527
							@Override
1528
							public int compareTo(final Object o) {
1529
								return 0;
1530
							}
1531

  
1532
							@Override
1533
							public Object getLeft() {
1534
								return field;
1535
							}
1536

  
1537
							@Override
1538
							public Object getRight() {
1539
								return value;
1540
							}
1541
						};
1524
					@Override
1525
					public void remove() {
1526
						throw new UnsupportedOperationException("cannot remove");
1542 1527
					}
1543 1528
				};
1544 1529
			}

Also available in: Unified diff