newLocation = oldLocation; } else { newLocation = ((BaseAllocator) oldShape.allocator()).locationForValueUpcast(value, oldLocation);
/** @since 0.17 or earlier */ protected ShapeImpl definePropertyChangeFlags(ShapeImpl oldShape, Property oldProperty, Object value, int flags) { Location oldLocation = oldProperty.getLocation(); Location newLocation; if (oldLocation.canSet(value)) { newLocation = oldLocation; } else { newLocation = oldShape.allocator().locationForValueUpcast(value, oldLocation); } Property newProperty = Property.create(oldProperty.getKey(), newLocation, flags); ShapeImpl newShape = oldShape.replaceProperty(oldProperty, newProperty); return newShape; }
/** @since 0.17 or earlier */ public Location existingLocationForValue(Object value, Location oldLocation, ShapeImpl oldShape) { assert oldShape.getLayout() == this.layout; Location newLocation; if (oldLocation.canSet(value)) { newLocation = oldLocation; } else { newLocation = oldShape.allocator().locationForValueUpcast(value, oldLocation); } return newLocation; } }
/** @since 0.17 or earlier */ protected ShapeImpl definePropertyChangeFlags(ShapeImpl oldShape, Property oldProperty, Object value, int flags) { Location oldLocation = oldProperty.getLocation(); Location newLocation; if (oldLocation.canSet(value)) { newLocation = oldLocation; } else { newLocation = oldShape.allocator().locationForValueUpcast(value, oldLocation); } Property newProperty = Property.create(oldProperty.getKey(), newLocation, flags); ShapeImpl newShape = oldShape.replaceProperty(oldProperty, newProperty); return newShape; }
/** @since 0.17 or earlier */ public Location existingLocationForValue(Object value, Location oldLocation, ShapeImpl oldShape) { assert oldShape.getLayout() == this.layout; Location newLocation; if (oldLocation.canSet(value)) { newLocation = oldLocation; } else { newLocation = oldShape.allocator().locationForValueUpcast(value, oldLocation); } return newLocation; } }
/** @since 0.17 or earlier */ protected ShapeImpl generalizeProperty(Property oldProperty, Object value, ShapeImpl currentShape, ShapeImpl nextShape) { Location oldLocation = oldProperty.getLocation(); Location newLocation = currentShape.allocator().locationForValueUpcast(value, oldLocation); Property newProperty = oldProperty.relocate(newLocation); ShapeImpl newShape = nextShape.replaceProperty(oldProperty, newProperty); return newShape; }
/** @since 0.17 or earlier */ protected ShapeImpl generalizeProperty(Property oldProperty, Object value, ShapeImpl currentShape, ShapeImpl nextShape) { Location oldLocation = oldProperty.getLocation(); Location newLocation = currentShape.allocator().locationForValueUpcast(value, oldLocation); Property newProperty = oldProperty.relocate(newLocation); ShapeImpl newShape = nextShape.replaceProperty(oldProperty, newProperty); return newShape; }