@Override public byte typeAt(final int index) { final NodeState resolved = this._resolver.resolveState(this); if (resolved != null) { return resolved.getType(index); } return -1; }
@Override public byte type(String name) { final NodeState resolved = this._resolver.resolveState(this); if (resolved != null) { return resolved.getType(this._resolver.stringToHash(name, false)); } return -1; }
@Override public byte type(String propertyName) { final NodeState resolved = this._resolver.resolveState(this); if (resolved != null) { return resolved.getType(this._resolver.stringToHash(propertyName, false)); } return -1; }
@Override public Node setAt(int index, byte type, Object value) { final NodeState unPhasedState = this._resolver.resolveState(this); boolean isDiff = (type != unPhasedState.getType(index)); if (!isDiff) { isDiff = !isEquals(unPhasedState.get(index), value, type); } if (isDiff) { final NodeState preciseState = this._resolver.alignState(this); if (preciseState != null) { preciseState.set(index, type, value); } else { throw new RuntimeException(Constants.CACHE_MISS_ERROR); } } return this; }
@Override public void setProperty(String propertyName, byte propertyType, Object propertyValue) { //hash the property a single time final long hashed = this._resolver.stringToHash(propertyName, true); final NodeState unPhasedState = this._resolver.resolveState(this); boolean isDiff = (propertyType != unPhasedState.getType(hashed)); if (!isDiff) { isDiff = !isEquals(unPhasedState.get(hashed), propertyValue, propertyType); } if (isDiff) { final NodeState preciseState = this._resolver.alignState(this); if (preciseState != null) { preciseState.set(hashed, propertyType, propertyValue); } else { throw new RuntimeException(Constants.CACHE_MISS_ERROR); } } }
switch (resolved.getType(relationIndex)) { case Type.RELATION: final Relation relation = (Relation) resolved.get(relationIndex);