If you think the Android project steamchat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.kevelbreh.steamchat.steam;
/*www.java2s.com*/import com.kevelbreh.steamchat.steam.util.BitVector64;
/**
* This represents a steam user.
*/publicclass SteamID {
/**
* Steam user id regex pattern.
*///public static final Pattern SteamIDRegex =
// Pattern.compile("STEAM_(?[0-5]):(?[0-1]):(?\\d+)",
// Pattern.CASE_INSENSITIVE);
/**
* Steam account instances.
*/publicstaticfinalint INSTANCE_ALL = 0;
publicstaticfinalint INSTANCE_DESKTOP = 1;
publicstaticfinalint INSTANCE_CONSOLE = 2;
publicstaticfinalint INSTANCE_WEB = 4;
/**
* Steam account and instance masks.
*/publicstaticfinalint MASK_ID = 0xFFFFFFFF;
publicstaticfinalint MASK_INSTANCE = 0x000FFFFF;
/**
* Steam chat instance flags.
*/publicstaticfinalint CHAT_FLAG_CLAN = MASK_INSTANCE + 1 >> 1;
publicstaticfinalint CHAT_FLAG_LOBBY = MASK_INSTANCE + 1 >> 2;
publicstaticfinalint CHAT_FLAG_MMS_LOBBY = MASK_INSTANCE + 1 >> 3;
/**
* This steam users steam id.
*/private BitVector64 steamid;
public SteamID() {
this(0);
}
public SteamID(long id) {
steamid = new BitVector64(id);
}
/*public SteamID(int id, int universe, int type) {
this()
setAccountID(id);
setAccountUniverse(universe);
setAccountType(type);
}*/public SteamID(int id, int instance, int universe, int type) {
this();
setAccountID(id);
setAccountInstance(instance);
setAccountUniverse(universe);
setAccountType(type);
}
/*public SteamID(String id) {
this(id, Universe.PUBLIC);
}
public SteamID(String id, int universe) {
}*/publiclong getLong() {
return steamid.getValue();
}
/**
* Gets the account id.
* @return The account id.
*/publiclong getAccountID() {
return steamid.getMask((short) 0, 0xFFFFFFFF);
}
/**
* Sets the account id.
* @param value The account id.
*/publicvoid setAccountID(long value) {
steamid.setMask((short) 0, 0xFFFFFFFF, value);
}
/**
* Gets the account instance.
* @return The account instance.
*/publiclong getAccountInstance() {
return steamid.getMask((short) 32, 0xFFFFF);
}
/**
* Sets the account instance.
* @param value The account instance.
*/publicvoid setAccountInstance(long value) {
steamid.setMask((short) 32, 0xFFFFF, value);
}
/**
* Gets the account type.
* @return The account type.
*/publicint getAccountType() {
return (int) steamid.getMask((short) 52, 0xF);
}
/**
* Sets the account type.
* @param value The account type.
*/publicvoid setAccountType(int value) {
steamid.setMask((short) 52, 0xF, value);
}
/**
* Gets the account universe.
* @return The account universe.
*/publicint getAccountUniverse() {
return (int) steamid.getMask((short) 56, 0xFF);
}
/**
* Sets the account universe.
* @param value The account universe.
*/publicvoid setAccountUniverse(int value) {
steamid.setMask((short) 56, 0xFF, value);
}
}