當前位置: 首頁>>代碼示例>>Java>>正文


Java UUID.getMostSignificantBits方法代碼示例

本文整理匯總了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;

    }
 
開發者ID:lisnstatic,項目名稱:live_master,代碼行數:17,代碼來源:UUIDConverter.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:8,代碼來源:VersionedStatsLRURegionEntryHeapUUIDKey.java

示例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());
}
 
開發者ID:JeanBarriere,項目名稱:Note,代碼行數:8,代碼來源:NoteNotification.java

示例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;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:10,代碼來源:VersionedStatsDiskLRURegionEntryOffHeapUUIDKey.java

示例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);
}
 
開發者ID:D3adspaceEnterprises,項目名稱:skylla,代碼行數:8,代碼來源:SkyllaBuffer.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:8,代碼來源:VMStatsDiskLRURegionEntryHeapUUIDKey.java

示例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()));
}
 
開發者ID:Twelvelines,項目名稱:AndroidMuseumBleManager,代碼行數:12,代碼來源:ScanFilterCompat.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:8,代碼來源:VMThinRegionEntryOffHeapUUIDKey.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:8,代碼來源:VMStatsLRURegionEntryOffHeapUUIDKey.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:9,代碼來源:VMStatsDiskRegionEntryOffHeapUUIDKey.java

示例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));

}
 
開發者ID:EixoX,項目名稱:jetfuel,代碼行數:20,代碼來源:Base36Tests.java

示例12: matchesServiceUuid

import java.util.UUID; //導入方法依賴的package包/類
private static boolean matchesServiceUuid(UUID uuid) {
    return SERVICE_UUID_HALF.getMostSignificantBits() == uuid.getMostSignificantBits();
}
 
開發者ID:aarmea,項目名稱:noise,代碼行數:4,代碼來源:BluetoothSyncService.java

示例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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:7,代碼來源:VersionedStatsRegionEntryHeapUUIDKey.java


注:本文中的java.util.UUID.getMostSignificantBits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。