本文整理匯總了Java中java.lang.Long.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Long.toString方法的具體用法?Java Long.toString怎麽用?Java Long.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.lang.Long
的用法示例。
在下文中一共展示了Long.toString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateGM
import java.lang.Long; //導入方法依賴的package包/類
void updateGM( long value, String name )
{
mApp.mDData.updateGMName( mCIDid, mApp.mCID, name );
String id = Long.toString(mCIDid);
// CalibCBlock blk = mApp.mDData.selectGM( mCIDid, mApp.mCID );
mSaveCBlock.setGroup( value );
// if ( mApp.mListRefresh ) {
// mDataAdapter.notifyDataSetChanged();
// } else {
mSaveTextView.setText( id + " <" + name + "> " + mSaveData );
mSaveTextView.setTextColor( mSaveCBlock.color() );
// mSaveTextView.invalidate();
// updateDisplay( ); // FIXME
// }
}
示例2: createDateInfo
import java.lang.Long; //導入方法依賴的package包/類
private static String createDateInfo(int second) {
String currentTime = Long.toString(System.currentTimeMillis());
while (currentTime.length() < 13) {
currentTime = "0" + currentTime;
}
return currentTime + "-" + second + mSeparator;
}
示例3: run
import java.lang.Long; //導入方法依賴的package包/類
public void run()
{
try
{
String slaveAddress = socket.getInetAddress().getHostAddress();
System.out.println("MasterThread: Received connection from a slave: " + slaveAddress);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String inputLine, outputLine;
//read input stream
inputLine = in.readLine(); //"time=?;<seq. no.>"
System.out.println("incoming message: '" + inputLine + "' from " + slaveAddress);
String[] parseIncomingMsg = inputLine.split(";");
//process input stream and compute time
String sequenceNumber = parseIncomingMsg[1];
Long nowLong = new Long(new Date().getTime());
outputLine = "time=;" + nowLong.toString() + ";" + sequenceNumber;
System.out.println("Outgoing message: '" + outputLine + "' to " + slaveAddress);
//send result
Socket sendSocket = new Socket(slaveAddress, slaveSendPort);
PrintWriter sendSocketOut = new PrintWriter(sendSocket.getOutputStream(), true);
sendSocketOut.println(outputLine);
sendSocketOut.close();
sendSocket.close();
in.close();
socket.close();
}
catch (IOException e)
{
e.toString();
}
}
示例4: toString
import java.lang.Long; //導入方法依賴的package包/類
/**
* toString in the form of numerator/denominator.
* @return String
*/
public String toString ()
{
return Long.toString (this.numerator) + "/" +
Long.toString (this.denominator);
}