java.lang.Object
com.maxmind.geoip.LookupService.Walker
- Enclosing class:
LookupService
Walks the search tree once, writing every address that maps to one segment.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]Scratch buffer for one node pair.private final intCountry segment index to walk.private final intStart offset of the first database segment.private final WriterWhere the walk writes its output.private final int[]Child offsets read from a node.Constructor Summary
Method Summary
Field Details
_country
private final int _countryCountry segment index to walk._out
Where the walk writes its output._buf
private final byte[] _bufScratch buffer for one node pair._x
private final int[] _xChild offsets read from a node._dbs0
private final int _dbs0Start offset of the first database segment.
Constructor Details
Walker
Prepares to walk the database records for one country.- Parameters:
country- the segment index of the country's recordout- where the walk writes its output- Throws:
IOException- declared by the signature, not thrown here
Method Details
walk
walk
Recursive, depth first.- Parameters:
offset- the node offset to walk fromip- the IPv4 address being walked, packed big endiandepth- the current depth in the tree- Throws:
IOException- if the database read fails