コード例 #1
0
 public ValueImpl(ValueDescriptorImpl<?> descriptor) {
   this.descriptor = descriptor;
   this.values = new Object[descriptor.getSize()];
   Collection<PropertyImpl> properties = descriptor.internalGetProperties();
   for (PropertyImpl property : properties) {
     values[property.getIndex()] = property.getInitializer().init();
   }
 }
コード例 #2
0
        @Override
        public Object handlePropertyAccess(Object self, ValueImpl impl, Object... args) {
          ValueDescriptorImpl<?> descriptor = impl.descriptor;

          int result = 0;
          for (PropertyImpl property : descriptor.internalGetProperties()) {
            Object value = property.getGetHandler().handlePropertyAccess(self, impl);
            result += (property.getIndex() + 1) * property.getParser().hashCode(value);
          }
          return result;
        }