本文整理汇总了Java中java.util.UUID.getLeastSignificantBits方法的典型用法代码示例。如果您正苦于以下问题:Java UUID.getLeastSignificantBits方法的具体用法?Java UUID.getLeastSignificantBits怎么用?Java UUID.getLeastSignificantBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.UUID
的用法示例。
在下文中一共展示了UUID.getLeastSignificantBits方法的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: EntityLiving
import java.util.UUID; //导入方法依赖的package包/类
public EntityLiving(World worldIn)
{
super(worldIn);
this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
this.lookHelper = new EntityLookHelper(this);
this.moveHelper = new EntityMoveHelper(this);
this.jumpHelper = new EntityJumpHelper(this);
this.bodyHelper = new EntityBodyHelper(this);
this.navigator = this.getNewNavigator(worldIn);
this.senses = new EntitySenses(this);
for (int i = 0; i < this.equipmentDropChances.length; ++i)
{
this.equipmentDropChances[i] = 0.085F;
}
UUID uuid = this.getUniqueID();
long j = uuid.getLeastSignificantBits();
this.randomMobsId = (int)(j & 2147483647L);
}
示例3: 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;
}
示例4: toInternalID
import java.util.UUID; //导入方法依赖的package包/类
/**
* Maps a global UUID to a numeric internal ID.
*
* @param id Global ID, must not be null.
* @return Mapped internal ID
*/
public static long toInternalID(UUID id) {
if (id == null) throw new IllegalArgumentException("id must not be null.");
if (id.getMostSignificantBits() != 0) throw new IllegalArgumentException("most significant bits must not be set.");
if (id.getLeastSignificantBits() < 0) throw new IllegalArgumentException("least significant bits must not be negative.");
return id.getLeastSignificantBits();
}
示例5: VMThinDiskLRURegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMThinDiskLRURegionEntryOffHeapUUIDKey(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();
}
示例6: VersionedStatsRegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VersionedStatsRegionEntryOffHeapUUIDKey(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();
}
示例7: VersionedStatsDiskRegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VersionedStatsDiskRegionEntryHeapUUIDKey(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();
}
示例8: VersionedStatsDiskLRURegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VersionedStatsDiskLRURegionEntryHeapUUIDKey(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();
}
示例9: VMThinDiskRegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMThinDiskRegionEntryHeapUUIDKey(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();
}
示例10: VMThinDiskRegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMThinDiskRegionEntryOffHeapUUIDKey(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: VMThinLRURegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMThinLRURegionEntryHeapUUIDKey(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();
}
示例12: VMStatsLRURegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMStatsLRURegionEntryHeapUUIDKey(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();
}
示例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();
}