반응형

 

 

public class SimulatorView extends View{

TimerTask timerTask = new TimerTask(){
        int frame = 0;
        @Override
        public void run() {
//            sim.grow();
            frame++;
            if(frame > 100) {
                invalidate();
                frame = 0;
            }
        }
    };

:

  public void start(){

    timer = new Timer();
    timer.schedule(timerTask,0, 20);
  }
}

'개발 Note > Codes' 카테고리의 다른 글

Singleton class 설계  (0) 2020.10.07
sorting algorithms  (0) 2014.02.26
UML2 Sementics  (0) 2012.01.11
반응형

유용하면서 간단한 디자인패턴 : 싱글톤 패턴

 

Singleton class  Basic type

 

 

public class Singleton {
	private volatile static Singleton uniqueInstance = null;
	
	private Singleton() {}
	public static Singleton getInstance (){
		if ( uniqueInstance == null){
			synchronized( Singleton.class){
				if (uniqueInstance == null)
					uniqueInstance = new Singleton();
			}
		}
		return uniqueInstance;
	}
}

 

 

 

'개발 Note > Codes' 카테고리의 다른 글

[Andriod] Timer and TimerTask  (0) 2020.10.22
sorting algorithms  (0) 2014.02.26
UML2 Sementics  (0) 2012.01.11
반응형

http://www.sorting-algorithms.com/


graph and animation.

'개발 Note > Codes' 카테고리의 다른 글

[Andriod] Timer and TimerTask  (0) 2020.10.22
Singleton class 설계  (0) 2020.10.07
UML2 Sementics  (0) 2012.01.11
반응형


UML의 표기를 수학적 모델로 표기한 내용입니다.


Subclass relation
∈∀ ∉

Nil ∈ UOID

∀C ∈ UCLASS: Nil ∉ oids(C)
∀o  ∈ INSTANCE : o.this ≠ Nil
UOID={Nil}  Uc∈ UCLASS objects(C)
INSTANCE = 
Uc∈ UCLASS objects(C) 
 

'개발 Note > Codes' 카테고리의 다른 글

[Andriod] Timer and TimerTask  (0) 2020.10.22
Singleton class 설계  (0) 2020.10.07
sorting algorithms  (0) 2014.02.26

+ Recent posts