本文整理汇总了Java中java.lang.InterruptedException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java InterruptedException.printStackTrace方法的具体用法?Java InterruptedException.printStackTrace怎么用?Java InterruptedException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.InterruptedException
的用法示例。
在下文中一共展示了InterruptedException.printStackTrace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareImages
import java.lang.InterruptedException; //导入方法依赖的package包/类
public void prepareImages() {
if (prepared) {
return;
}
MediaTracker mt = new MediaTracker(this);
for (int i = 0; i < images.length; i++) {
mt.addImage(images[i], i);
}
try {
mt.waitForAll();
} catch (InterruptedException e) {
e.printStackTrace();
}
for (int i = 0; i < images.length; i++) {
mt.removeImage(images[i], i);
}
if (params.scaleFactor != 1) {
// TODO: scale if needed
logger.unimplemented("image_scaling");
}
prepared = true;
}
示例2: run
import java.lang.InterruptedException; //导入方法依赖的package包/类
@Override
public void run() {
Message m;
Bundle b = new Bundle();
while(true) {
float maxRotation = INITIAL_ROTATION + (Math.abs(INITIAL_ROTATION)*2*speed);
m = Message.obtain();
b.putFloat("rotation", currentRotation);
m.setData(b);
handler.sendMessage(m);
try {
if(currentRotation <= maxRotation){
currentRotation+=speed;
sleep((long)Math.ceil((double)(10-(10*speed))));
}
else {
currentRotation-=0.8;
sleep(10);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
示例3: run
import java.lang.InterruptedException; //导入方法依赖的package包/类
public void run() {
int FPS = 0;
long timer = 0;
long lastUpdate = System.currentTimeMillis();
while ( this.isRunning ) {
long delta = System.currentTimeMillis() - lastUpdate;
this.update( delta );
timer += delta;
lastUpdate = System.currentTimeMillis();
FPS++;
this.render();
try {
Thread.sleep( 1 );
} catch ( InterruptedException e ) {
e.printStackTrace();
}
if ( timer > 1000 ) {
System.out.println( "FPS: " + FPS );
FPS = 0;
timer = 0;
}
}
}
示例4: setTreeTopNode
import java.lang.InterruptedException; //导入方法依赖的package包/类
public void setTreeTopNode(){
synchronized(this){
try{
while(flag){
wait();
}
flag = true?(flag=false):(flag=true);
updateTreeTopNode();
notify();
}catch(InterruptedException e){
e.printStackTrace();
}
}
}
示例5: getTreeTopNode
import java.lang.InterruptedException; //导入方法依赖的package包/类
public void getTreeTopNode()
{
synchronized(this){
try{
while(!flag){
wait();
}
flag = true?(flag=false):(flag=true);
notify();
}catch(InterruptedException e)
{
e.printStackTrace();
}
}
}