Exemplo n.º 1
0
 TreeMultiset(Comparator<? super E> comparator) {
   super(comparator);
   this.range = GeneralRange.all(comparator);
   this.header = new AvlNode<E>(null, 1);
   successor(header, header);
   this.rootReference = new Reference<AvlNode<E>>();
 }
Exemplo n.º 2
0
 @GwtIncompatible // java.io.ObjectInputStream
 private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
   stream.defaultReadObject();
   @SuppressWarnings("unchecked")
   // reading data stored by writeObject
   Comparator<? super E> comparator = (Comparator<? super E>) stream.readObject();
   Serialization.getFieldSetter(AbstractSortedMultiset.class, "comparator").set(this, comparator);
   Serialization.getFieldSetter(TreeMultiset.class, "range")
       .set(this, GeneralRange.all(comparator));
   Serialization.getFieldSetter(TreeMultiset.class, "rootReference")
       .set(this, new Reference<AvlNode<E>>());
   AvlNode<E> header = new AvlNode<E>(null, 1);
   Serialization.getFieldSetter(TreeMultiset.class, "header").set(this, header);
   successor(header, header);
   Serialization.populateMultiset(this, stream);
 }