Code example for SortedMap

Methods: entrySet

0
      if (entry == -1) {
        entry = qlock.addEntry(new ParsedLock(this.lockType(), this.userData).getLockData());
        log.info("Added lock entry " + entry + " userData " + new String(this.userData) + " lockType " + lockType());
      } 
      SortedMap<Long,byte[]> entries = qlock.getEarlierEntries(entry);
      Iterator<Entry<Long,byte[]>> iterator = entries.entrySet().iterator();
      if (!iterator.hasNext())
        throw new IllegalStateException("Did not find our own lock in the queue: " + this.entry + " userData " + new String(this.userData) + " lockType "
            + lockType()); 
      if (iterator.next().getKey().equals(entry))
        return true; 
      return false; 
    } 
  } 
   
  private QueueLock qlock;
  private byte[] data;
   
  public DistributedReadWriteLock(QueueLock qlock, byte[] data) {
    this.qlock = qlock;
    this.data = Arrays.copyOf(data, data.length);