Package org.jgroups.util
Class FlagsUUID
java.lang.Object
org.jgroups.util.UUID
org.jgroups.util.FlagsUUID
- All Implemented Interfaces:
Comparable<Address>,Address,Constructable<UUID>,SizeStreamable,Streamable
- Direct Known Subclasses:
ExtendedUUID
Subclass of
UUID accommodating additional data such as a flag. There may be many instances
in memory, and as they are serialized a lot and sent across the wire, I tried to make this as compact as possible.- Since:
- 3.5
-
Field Summary
FieldsFields inherited from class org.jgroups.util.UUID
leastSigBits, mostSigBits, SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends FlagsUUID>
TaddContents(T other) <T extends FlagsUUID>
TclearFlag(short flag) create()Creates an instance of the class implementing this interfacebooleanisFlagSet(short flag) static FlagsUUIDstatic FlagsUUIDrandomUUID(String name) voidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedintThe number of bytes required to serialize this instance<T extends FlagsUUID>
TsetFlag(short flag) toString()voidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.Methods inherited from class org.jgroups.util.UUID
compareTo, compareTo, copy, digits, equals, fromString, generateRandomBytes, getLeastSignificantBits, getMostSignificantBits, hashCode, printName, toStringLongMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgroups.Address
isMulticast, isSiteAddress, isSiteMaster
-
Field Details
-
flags
protected int flags
-
-
Constructor Details
-
FlagsUUID
public FlagsUUID() -
FlagsUUID
protected FlagsUUID(byte[] data) -
FlagsUUID
public FlagsUUID(long mostSigBits, long leastSigBits) -
FlagsUUID
public FlagsUUID(T other)
-
-
Method Details
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<UUID>- Overrides:
createin classUUID
-
randomUUID
-
randomUUID
-
setFlag
-
clearFlag
-
isFlagSet
public boolean isFlagSet(short flag) -
addContents
-
writeTo
Description copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classUUID- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classUUID- Throws:
IOException
-
serializedSize
public int serializedSize()The number of bytes required to serialize this instance- Specified by:
serializedSizein interfaceSizeStreamable- Overrides:
serializedSizein classUUID
-
toString
-