/** * Returns the location column in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationColumn(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationColumn; } } return 0; }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
/** * Returns the location line in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationLine(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationLine; } } return 0; }
/** * Returns the location column in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationColumn(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationColumn; } } return 0; }
/** * Returns the location column in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationColumn(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationColumn; } } return 0; }
/** * Returns the location line in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationLine(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationLine; } } return 0; }
/** * Returns the location line in the source file of the end element. * @return zero if the information is unknown. */ public int getLocationLine(Element elt) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) return e.locationLine; } } return 0; }