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