本文整理匯總了Java中java.util.UUID.getMostSignificantBits方法的典型用法代碼示例。如果您正苦於以下問題:Java UUID.getMostSignificantBits方法的具體用法?Java UUID.getMostSignificantBits怎麽用?Java UUID.getMostSignificantBits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.UUID
的用法示例。
在下文中一共展示了UUID.getMostSignificantBits方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convert
import java.util.UUID; //導入方法依賴的package包/類
public static byte[] convert(UUID uuid) {
long msb = uuid.getMostSignificantBits();
long lsb = uuid.getLeastSignificantBits();
byte[] buffer = new byte[16];
for (int i = 0; i < 8; i++) {
buffer[i] = (byte) (msb >>> 8 * (7 - i));
}
for (int i = 8; i < 16; i++) {
buffer[i] = (byte) (lsb >>> 8 * (7 - i));
}
return buffer;
}
示例2: VersionedStatsLRURegionEntryHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VersionedStatsLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例3: NoteNotification
import java.util.UUID; //導入方法依賴的package包/類
public NoteNotification(String parentId, String notificationContent, Long delay) {
this.content = notificationContent;
this.delay = delay;
UUID uuid = UUID.randomUUID();
this.parentId = parentId;
this.id = (int)(uuid.getMostSignificantBits() + uuid.getLeastSignificantBits());
}
示例4: isKeyEqual
import java.util.UUID; //導入方法依賴的package包/類
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
UUID uuid = (UUID) k;
return uuid.getLeastSignificantBits() == this.keyLeastSigBits
&& uuid.getMostSignificantBits() == this.keyMostSigBits;
}
return false;
}
示例5: writeUniqueId
import java.util.UUID; //導入方法依賴的package包/類
public void writeUniqueId(UUID uniqueId) {
long most = uniqueId.getMostSignificantBits();
long least = uniqueId.getLeastSignificantBits();
this.writeLong(most);
this.writeLong(least);
}
示例6: VMStatsDiskLRURegionEntryHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VMStatsDiskLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) {
super(context, (value instanceof RecoveredEntry ? null : value));
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例7: matchesServiceUuid
import java.util.UUID; //導入方法依賴的package包/類
private boolean matchesServiceUuid(UUID uuid, UUID mask, UUID data) {
if (mask == null) {
return uuid.equals(data);
}
if ((uuid.getLeastSignificantBits() & mask.getLeastSignificantBits()) !=
(data.getLeastSignificantBits() & mask.getLeastSignificantBits())) {
return false;
}
return ((uuid.getMostSignificantBits() & mask.getMostSignificantBits()) ==
(data.getMostSignificantBits() & mask.getMostSignificantBits()));
}
示例8: VMThinRegionEntryOffHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VMThinRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例9: VMStatsLRURegionEntryOffHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VMStatsLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例10: VMStatsDiskRegionEntryOffHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VMStatsDiskRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, (value instanceof RecoveredEntry ? null : value));
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例11: testFormats
import java.util.UUID; //導入方法依賴的package包/類
@Test
public void testFormats() {
UUID uid = UUID.randomUUID();
long hi = uid.getMostSignificantBits();
long lo = uid.getLeastSignificantBits();
String shi = Long.toString(hi, 36);
String slo = Long.toString(lo, 36);
System.out.println(shi);
System.out.println(slo);
System.out.println(shi + slo);
System.out.println(Long.toString(Long.MAX_VALUE, 36));
}
示例12: matchesServiceUuid
import java.util.UUID; //導入方法依賴的package包/類
private static boolean matchesServiceUuid(UUID uuid) {
return SERVICE_UUID_HALF.getMostSignificantBits() == uuid.getMostSignificantBits();
}
示例13: VersionedStatsRegionEntryHeapUUIDKey
import java.util.UUID; //導入方法依賴的package包/類
public VersionedStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}