本文整理匯總了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();
}
}
}