Package org.ardverk.version

Examples of org.ardverk.version.Vector


        DataUtils.short2beb(vclock.size(), out);
       
        for (Map.Entry<String, ? extends Vector> entry
            : vclock.entrySet()) {
          String key = entry.getKey();
          Vector value = entry.getValue();
         
          StringUtils.writeString(key, out);
          DataUtils.int2beb(value.getValue(), out);
        }
       
      } catch (IOException err) {
        throw new IllegalStateException("IOException", err);
      } finally {
View Full Code Here


      DataUtils.long2beb(vclock.getCreationTime(), out);
     
      for (Map.Entry<String, ? extends Vector> entry
          : vclock.entrySet()) {
        String key = entry.getKey();
        Vector value = entry.getValue();
       
        StringUtils.writeString(key, out);
       
        DataUtils.long2beb(value.getTimeStamp(), out);
        DataUtils.int2beb(value.getValue(), out);
      }
    }
  }
View Full Code Here

        String id = StringUtils.readString(in);
       
        long timeStamp = DataUtils.beb2long(in);
        int value = DataUtils.beb2int(in);
       
        map.put(id, new Vector(timeStamp, value));
      }
    }
   
    VectorClock<String> vclock = VectorClock.create(creationTime, map);
    return new Vclock(key, vclock);
View Full Code Here

    long creationTime = readLong();
    SortedMap<KUID, Vector> dst = new TreeMap<KUID, Vector>();
   
    while (0 < count--) {
      KUID contactId = readKUID();
      Vector vector = readVector();
     
      if (!vector.isEmpty()) {
        dst.put(contactId, vector);
      }
    }
   
    return VectorClock.create(creationTime, dst);
View Full Code Here

  }
 
  private Vector readVector() throws IOException {
    long timeStamp = readLong();
    int value = readInt();
    return new Vector(timeStamp, value);
  }
View Full Code Here

    if (0 < size) {
      writeLong(clock.getCreationTime());
      for (Map.Entry<? extends KUID, ? extends Vector> entry
          : clock.entrySet()) {
        KUID contactId = entry.getKey();
        Vector vector = entry.getValue();
       
        writeKUID(contactId);
        writeVector(vector);
      }
    }
View Full Code Here

TOP

Related Classes of org.ardverk.version.Vector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.