@Override public String toString() { String s = super.toString(); int pos = getValuePosition()*4; return s.substring(0,pos-1) + "->" + s.substring(pos); }
@Override public Entry next() { if (!hasNext()) throw new NoSuchElementException(); currentIndex++; int newOffset = currentIndex>0?getLimit(limitAndValuePos[currentIndex-1]):0; metadata = EntryMetaData.EMPTY_METADATA; if (StaticArrayEntryList.this.hasMetaData()) { metadata = new EntryMetaData.Map(); newOffset = parseMetaData(metadata,newOffset); } super.reset(newOffset,getLimit(limitAndValuePos[currentIndex])); currentValuePos = getValuePos(limitAndValuePos[currentIndex]); return this; }
public boolean hasMetaData() { verifyAccess(); return !metadata.isEmpty(); }
@Override public Iterator<Entry> reuseIterator() { return new SwappingEntry(); }
@Override public int hashCode() { return hashCode(getValuePosition()); }
@Override public StaticBuffer getValue() { return getValueAs(StaticBuffer.STATIC_FACTORY); }
@Override public boolean hasValue() { return currentValuePos<length(); }
@Override public RelationCache getCache() { verifyAccess(); return caches[currentIndex]; }
@Override public Map<EntryMetaData,Object> getMetaData() { verifyAccess(); return metadata; }
@Override public int getValuePosition() { verifyAccess(); return currentValuePos; }
@Override public StaticBuffer getColumn() { return getColumnAs(StaticBuffer.STATIC_FACTORY); }
@Override public int compareTo(StaticBuffer other) { int otherLen = (other instanceof Entry)?((Entry) other).getValuePosition():other.length(); return compareTo(getValuePosition(),other, otherLen); }
@Override public void setCache(RelationCache cache) { verifyAccess(); caches[currentIndex]=cache; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (!(o instanceof StaticBuffer)) return false; final Entry b = (Entry) o; return getValuePosition() == b.getValuePosition() && compareTo(getValuePosition(), b, getValuePosition()) == 0; }