本文整理了Java中java.util.concurrent.atomic.AtomicInteger.toString()
方法的一些代码示例,展示了AtomicInteger.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AtomicInteger.toString()
方法的具体详情如下:
包路径:java.util.concurrent.atomic.AtomicInteger
类名称:AtomicInteger
方法名:toString
[英]Returns the String representation of the current value.
[中]返回当前值的字符串表示形式。
代码示例来源:origin: square/dagger
private ClassName bindingClassName(ClassName adapterName, ExecutableElement providerMethod,
Map<ExecutableElement, ClassName> methodToClassName,
Map<String, AtomicInteger> methodNameToNextId) {
ClassName className = methodToClassName.get(providerMethod);
if (className != null) return className;
String methodName = providerMethod.getSimpleName().toString();
String suffix = "";
AtomicInteger id = methodNameToNextId.get(methodName);
if (id == null) {
methodNameToNextId.put(methodName, new AtomicInteger(2));
} else {
suffix = id.toString();
id.incrementAndGet();
}
String uppercaseMethodName = Character.toUpperCase(methodName.charAt(0))
+ methodName.substring(1);
className = adapterName.nestedClass(uppercaseMethodName + "ProvidesAdapter" + suffix);
methodToClassName.put(providerMethod, className);
return className;
}
代码示例来源:origin: alibaba/TProfiler
/**
* 写出方法信息
*/
public synchronized static void flushMethodData() {
fileWriter.append("instrumentclass:");
fileWriter.append(Profiler.instrumentClassCount.toString());
fileWriter.append(" instrumentmethod:");
fileWriter.append(Profiler.instrumentMethodCount.toString());
fileWriter.append("\n");
Vector<MethodInfo> vector = mCacheMethods;
int size = vector.size();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < size; i++) {
sb.append(i);
sb.append(' ');
sb.append(vector.get(i).toString());
sb.append('\n');
fileWriter.append(sb.toString());
sb.setLength(0);
if ((i % 50) == 0) {
fileWriter.flushAppend();
}
}
fileWriter.flushAppend();
}
}
代码示例来源:origin: apache/hbase
assertTrue(reCount.toString(), reCount.get() >= store.getNumThreads() &&
reCount.get() < thread.length);
代码示例来源:origin: org.simpleframework/simple-xml
/**
* This method is used to convert the provided value into an XML
* usable format. This is used in the serialization process when
* there is a need to convert a field value in to a string so
* that that value can be written as a valid XML entity.
*
* @param value this is the value to be converted to a string
*
* @return this is the string representation of the given value
*/
public String write(AtomicInteger value) {
return value.toString();
}
}
代码示例来源:origin: darren-fu/pampas
public String toString() {
return i.toString();
}
代码示例来源:origin: org.restlet.lib/org.simpleframework.simple-xml
/**
* This method is used to convert the provided value into an XML
* usable format. This is used in the serialization process when
* there is a need to convert a field value in to a string so
* that that value can be written as a valid XML entity.
*
* @param value this is the value to be converted to a string
*
* @return this is the string representation of the given value
*/
public String write(AtomicInteger value) {
return value.toString();
}
}
代码示例来源:origin: net.oschina.jmind/jmind-base
public String toString() {
return i.toString();
}
代码示例来源:origin: com.cedarsoftware/json-io
public void writePrimitiveForm(Object o, Writer output) throws IOException
{
AtomicInteger value = (AtomicInteger) o;
output.write(value.toString());
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-perfan
void releaseLock() {
synchronized (this) {
locks.decrementAndGet();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "{0} locks count == {1}", new Object[]{logPrefix, locks.toString()}); // NOI18N
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-perfan
void addLock() throws IllegalStateException {
synchronized (this) {
if (stopped) {
throw new IllegalStateException("er_print is scheduled to be stopped already!"); // NOI18N
}
locks.incrementAndGet();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "{0}locks count == {1}", new Object[]{logPrefix, locks.toString()}); // NOI18N
}
}
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
public String listRemovedReferenceToString() {
if (classesRemoved == null) {
return "";
}
final StringBuilder builder = new StringBuilder(500);
builder.append("List of classes removed in Java layer:\n");
for (Entry<String, AtomicInteger> entry : classesRemoved.entrySet()) {
builder.append(" - ").append(entry.getKey()).append(": ").append(entry.getValue().toString()).append("\n");
}
return builder.toString();
}
代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub
public String listKeptReferenceToString() {
if (classesKept == null) {
return "";
}
final StringBuilder builder = new StringBuilder(500);
builder.append("List of classes kept in Java layer:\n");
for (Entry<String, AtomicInteger> entry : classesKept.entrySet()) {
builder.append(" - ").append(entry.getKey()).append(": ").append(entry.getValue().toString()).append("\n");
}
return builder.toString();
}
代码示例来源:origin: com.cedarsoftware/json-io
public void write(Object obj, boolean showType, Writer output) throws IOException
{
if (showType)
{
AtomicInteger value = (AtomicInteger) obj;
output.write("\"value\":");
output.write(value.toString());
}
else
{
writePrimitiveForm(obj, output);
}
}
代码示例来源:origin: com.github.ansell.owlapi/owlapi-rio
@Override
public void endRDF() throws RDFHandlerException
{
this.logger.debug("Parsed {} statements", this.statementCount.toString());
try
{
this.endModel();
}
catch(final SAXException e)
{
throw new RDFHandlerException(e);
}
}
代码示例来源:origin: termd/termd
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
代码示例来源:origin: io.termd/termd-core
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
代码示例来源:origin: io.termd/termd-core
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
代码示例来源:origin: com.alibaba.middleware/termd-core
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
代码示例来源:origin: com.alibaba.middleware/termd-core
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
代码示例来源:origin: termd/termd
@Override
public boolean authenticate(String username, String password, ServerSession session)
throws PasswordChangeRequiredException {
if (attemptsCount.incrementAndGet() == 1) {
throw new PasswordChangeRequiredException(attemptsCount.toString(), getCurrentTestName(), ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
}
return delegate.authenticate(username, password, session);
}
});
内容来源于网络,如有侵权,请联系作者删除!