com.threerings.presents.peer.data
Class NodeObject.Lock

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.presents.peer.data.NodeObject.Lock
All Implemented Interfaces:
Streamable, DSet.Entry, Comparable<NodeObject.Lock>
Enclosing class:
NodeObject

public static class NodeObject.Lock
extends SimpleStreamableObject
implements Comparable<NodeObject.Lock>, DSet.Entry

Identifies a locked resource.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
 Comparable<?> id
          The resource identifier, which can be null for singleton resources.
 String type
          The resource type.
 
Constructor Summary
NodeObject.Lock(String type, Comparable<?> id)
           
 
Method Summary
 int compareTo(NodeObject.Lock olock)
           
 boolean equals(Object other)
           
 Comparable<?> getKey()
          Each entry provide an associated key which is used to determine its uniqueness in the set.
 int hashCode()
           
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public final String type
The resource type. Only resources of the same type will have their ids compared.


id

public final Comparable<?> id
The resource identifier, which can be null for singleton resources.

Constructor Detail

NodeObject.Lock

public NodeObject.Lock(String type,
                       Comparable<?> id)
Method Detail

compareTo

public int compareTo(NodeObject.Lock olock)
Specified by:
compareTo in interface Comparable<NodeObject.Lock>

getKey

public Comparable<?> getKey()
Description copied from interface: DSet.Entry
Each entry provide an associated key which is used to determine its uniqueness in the set. See the DSet class documentation for further information.

Specified by:
getKey in interface DSet.Entry

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object