DocumentBasedWaveletReadState(DocumentEventRouter<? super E, E, ?> router, E container) { this.router = router; this.container = container; blips = DocumentBasedMonotonicMap.create(router, container, Serializer.STRING, Serializer.INTEGER, WaveletBasedSupplement.BLIP_READ_TAG, WaveletBasedSupplement.ID_ATTR, WaveletBasedSupplement.VERSION_ATTR); participants = DocumentBasedMonotonicValue.create(router, container, Serializer.INTEGER, WaveletBasedSupplement.PARTICIPANTS_READ_TAG, WaveletBasedSupplement.VERSION_ATTR); tags = DocumentBasedMonotonicValue.create(router, container, Serializer.INTEGER, WaveletBasedSupplement.TAGS_READ_TAG, WaveletBasedSupplement.VERSION_ATTR); wavelet = DocumentBasedMonotonicValue.create(router, container, Serializer.INTEGER, WaveletBasedSupplement.WAVELET_READ_TAG, WaveletBasedSupplement.VERSION_ATTR); }
/** * Creates a target map on a substrate. */ private <N, E extends N> void createTargetOn(ValueContext<N, E> context) { DocumentBasedMonotonicValue<E, Integer> target = DocumentBasedMonotonicValue.create(DefaultDocumentEventRouter.create(context.doc), context.container, Serializer.INTEGER, ENTRY_TAG, VALUE_ATTR); // Eventually, the target map and the substrate should be sufficient state for all tests. // However, in order to simulate document events, the two need to be wrapped together in a // FungeStack so that Java knows that the element type-parameters match. stack = new FungeStack<N, E, Integer>(context, target, Serializer.INTEGER); }
/** * Creates a target map on a substrate. */ private <N, E extends N> void createTargetOn(ValueContext<N, E> context) { DocumentBasedMonotonicValue<E, Integer> target = DocumentBasedMonotonicValue.create(DefaultDocumentEventRouter.create(context.doc), context.container, Serializer.INTEGER, ENTRY_TAG, VALUE_ATTR); // Eventually, the target map and the substrate should be sufficient state for all tests. // However, in order to simulate document events, the two need to be wrapped together in a // FungeStack so that Java knows that the element type-parameters match. stack = new FungeStack<N, E, Integer>(context, target, Serializer.INTEGER); }