当前位置: 首页>>代码示例>>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;未经允许,请勿转载。