本文整理汇总了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);
}