MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / iterator

Method iterator

src/main/java/core/org/xbill/DNS/RRset.java:112–147  ·  view source on GitHub ↗
(boolean data, boolean cycle)

Source from the content-addressed store, hash-verified

110}
111
112private synchronized Iterator
113iterator(boolean data, boolean cycle) {
114 int size, start, total;
115
116 total = rrs.size();
117
118 if (data)
119 size = total - nsigs;
120 else
121 size = nsigs;
122 if (size == 0)
123 return Collections.EMPTY_LIST.iterator();
124
125 if (data) {
126 if (!cycle)
127 start = 0;
128 else {
129 if (position >= size)
130 position = 0;
131 start = position++;
132 }
133 } else {
134 start = total - nsigs;
135 }
136
137 List list = new ArrayList(size);
138 if (data) {
139 list.addAll(rrs.subList(start, size));
140 if (start != 0)
141 list.addAll(rrs.subList(0, start));
142 } else {
143 list.addAll(rrs.subList(start, total));
144 }
145
146 return list.iterator();
147}
148
149/**
150 * Returns an Iterator listing all (data) records.

Callers 3

rrsMethod · 0.95
sigsMethod · 0.95
toStringMethod · 0.95

Calls 2

sizeMethod · 0.45
addAllMethod · 0.45

Tested by

no test coverage detected