public synchronized static int registerDomain(CharSequence host) {
int hostId = (int)TrieParserReader.query(new TrieParserReader(true), domainRegistry, host);
if (-1==hostId) {
hostId = totalKnownDomains++;
domainRegistry.setUTF8Value(host, hostId);
if (hostId==conTables.length) {
LongLongHashTable[] bigger = new LongLongHashTable[conTables.length*2];
System.arraycopy(conTables, 0, bigger, 0, conTables.length);
conTables = bigger;
}
conTables[hostId] = new LongLongHashTable(5);
String strDomain = host instanceof String ? (String)host : host.toString();
domainLookupArray = ArrayGrow.setIntoArray(domainLookupArray,
strDomain,
hostId);
domainLookupArrayBytes = ArrayGrow.setIntoArray(domainLookupArrayBytes,
strDomain.getBytes(), hostId);
}
return hostId;
}