C# 클래스 Rhino.Kit

Collection of utilities
파일 보기 프로젝트 열기: hazzik/Rhino.Net

공개 메소드들

메소드 설명
AddListener ( object bag, object listener ) : object

Add listener to bag of listeners.

Add listener to bag of listeners. The function does not modify bag and return a new collection containing listener and all listeners from bag. Bag without listeners always represented as the null value.

Usage example:

 private volatile Object changeListeners; public void addMyListener(PropertyChangeListener l) { synchronized (this) { changeListeners = Kit.addListener(changeListeners, l); } } public void removeTextListener(PropertyChangeListener l) { synchronized (this) { changeListeners = Kit.removeListener(changeListeners, l); } } public void fireChangeEvent(Object oldValue, Object newValue) { // Get immune local copy Object listeners = changeListeners; if (listeners != null) { PropertyChangeEvent e = new PropertyChangeEvent( this, "someProperty" oldValue, newValue); for (int i = 0; ; ++i) { Object l = Kit.getListener(listeners, i); if (l == null) break; ((PropertyChangeListener)l).propertyChange(e); } } } 
ClassOrNull ( ClassLoader loader, string className ) : Type

Attempt to load the class of the given name.

Attempt to load the class of the given name. Note that the type parameter isn't checked.

ClassOrNull ( string className ) : Type
CodeBug ( ) : Exception

Throws RuntimeException to indicate failed assertion.

Throws RuntimeException to indicate failed assertion. The function never returns and its return type is RuntimeException only to be able to write throw Kit.codeBug() if plain Kit.codeBug() triggers unreachable code error.

CodeBug ( string msg ) : Exception

Throws RuntimeException to indicate failed assertion.

Throws RuntimeException to indicate failed assertion. The function never returns and its return type is RuntimeException only to be able to write throw Kit.codeBug() if plain Kit.codeBug() triggers unreachable code error.

GetListener ( object bag, int index ) : object

Get listener at index position in bag or null if index equals to number of listeners in bag.

Get listener at index position in bag or null if index equals to number of listeners in bag.

For usage example, see AddListener(object, object) .

InitCause ( Exception ex, Exception cause ) : Exception

If initCause methods exists in Throwable, call ex.initCause(cause) or otherwise do nothing.

If initCause methods exists in Throwable, call ex.initCause(cause) or otherwise do nothing.

MakeHashKeyFromPair ( object key1, object key2 ) : object
ReadReader ( TextReader r ) : string
ReadStream ( Stream @is, int initialBufferCapacity ) : byte[]
RemoveListener ( object bag, object listener ) : object

Remove listener from bag of listeners.

Remove listener from bag of listeners. The function does not modify bag and return a new collection containing all listeners from bag except listener. If bag does not contain listener, the function returns bag.

For usage example, see AddListener(object, object) .

XDigitToInt ( int c, int accumulator ) : int

If character c is a hexadecimal digit, return accumulator * 16 plus corresponding number.

If character c is a hexadecimal digit, return accumulator * 16 plus corresponding number. Otherise return -1.

비공개 메소드들

메소드 설명
InitHash ( object>.IDictionary h, object key, object initialValue ) : object
Kit ( ) : System
NewInstanceOrNull ( Type cl ) : object
TestIfCanLoadRhinoClasses ( ClassLoader loader ) : bool

Check that testClass is accessible from the given loader.

Check that testClass is accessible from the given loader.

메소드 상세

AddListener() 공개 정적인 메소드

Add listener to bag of listeners.
Add listener to bag of listeners. The function does not modify bag and return a new collection containing listener and all listeners from bag. Bag without listeners always represented as the null value.

Usage example:

 private volatile Object changeListeners; public void addMyListener(PropertyChangeListener l) { synchronized (this) { changeListeners = Kit.addListener(changeListeners, l); } } public void removeTextListener(PropertyChangeListener l) { synchronized (this) { changeListeners = Kit.removeListener(changeListeners, l); } } public void fireChangeEvent(Object oldValue, Object newValue) { // Get immune local copy Object listeners = changeListeners; if (listeners != null) { PropertyChangeEvent e = new PropertyChangeEvent( this, "someProperty" oldValue, newValue); for (int i = 0; ; ++i) { Object l = Kit.getListener(listeners, i); if (l == null) break; ((PropertyChangeListener)l).propertyChange(e); } } } 
public static AddListener ( object bag, object listener ) : object
bag object Current collection of listeners.
listener object Listener to add to bag
리턴 object

ClassOrNull() 공개 정적인 메소드

Attempt to load the class of the given name.
Attempt to load the class of the given name. Note that the type parameter isn't checked.
public static ClassOrNull ( ClassLoader loader, string className ) : Type
loader ClassLoader
className string
리턴 System.Type

ClassOrNull() 공개 정적인 메소드

public static ClassOrNull ( string className ) : Type
className string
리턴 System.Type

CodeBug() 공개 정적인 메소드

Throws RuntimeException to indicate failed assertion.
Throws RuntimeException to indicate failed assertion. The function never returns and its return type is RuntimeException only to be able to write throw Kit.codeBug() if plain Kit.codeBug() triggers unreachable code error.
public static CodeBug ( ) : Exception
리턴 System.Exception

CodeBug() 공개 정적인 메소드

Throws RuntimeException to indicate failed assertion.
Throws RuntimeException to indicate failed assertion. The function never returns and its return type is RuntimeException only to be able to write throw Kit.codeBug() if plain Kit.codeBug() triggers unreachable code error.
public static CodeBug ( string msg ) : Exception
msg string
리턴 System.Exception

GetListener() 공개 정적인 메소드

Get listener at index position in bag or null if index equals to number of listeners in bag.
Get listener at index position in bag or null if index equals to number of listeners in bag.

For usage example, see AddListener(object, object) .

public static GetListener ( object bag, int index ) : object
bag object Current collection of listeners.
index int Index of the listener to access.
리턴 object

InitCause() 공개 정적인 메소드

If initCause methods exists in Throwable, call ex.initCause(cause) or otherwise do nothing.
If initCause methods exists in Throwable, call ex.initCause(cause) or otherwise do nothing.
public static InitCause ( Exception ex, Exception cause ) : Exception
ex System.Exception
cause System.Exception
리턴 System.Exception

MakeHashKeyFromPair() 공개 정적인 메소드

public static MakeHashKeyFromPair ( object key1, object key2 ) : object
key1 object
key2 object
리턴 object

ReadReader() 공개 정적인 메소드

public static ReadReader ( TextReader r ) : string
r System.IO.TextReader
리턴 string

ReadStream() 공개 정적인 메소드

public static ReadStream ( Stream @is, int initialBufferCapacity ) : byte[]
@is Stream
initialBufferCapacity int
리턴 byte[]

RemoveListener() 공개 정적인 메소드

Remove listener from bag of listeners.
Remove listener from bag of listeners. The function does not modify bag and return a new collection containing all listeners from bag except listener. If bag does not contain listener, the function returns bag.

For usage example, see AddListener(object, object) .

public static RemoveListener ( object bag, object listener ) : object
bag object Current collection of listeners.
listener object Listener to remove from bag
리턴 object

XDigitToInt() 공개 정적인 메소드

If character c is a hexadecimal digit, return accumulator * 16 plus corresponding number.
If character c is a hexadecimal digit, return accumulator * 16 plus corresponding number. Otherise return -1.
public static XDigitToInt ( int c, int accumulator ) : int
c int
accumulator int
리턴 int