C# 클래스 SimpleFramework.Xml.Core.Template

This is primarily used to replace the StringBuffer class, as a way for the TemplateEngine to store the data for a specific region within the parse data that constitutes a desired value. The methods are not synchronized so it enables the characters to be taken quicker than the string buffer class.
파일 보기 프로젝트 열기: ngallagher/simplexml 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
buf char[]
cache String
count int

공개 메소드들

메소드 설명
Append ( String str ) : void

This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.

Append ( String str, int off, int len ) : void

This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.

Append ( Template text ) : void

This will add a Template to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large Template objects.

Append ( Template text, int off, int len ) : void

This will add a Template to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large Template objects.

Append ( char c ) : void

This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate more characters.

Append ( char c, int off, int len ) : void

This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large char arrays.

Clear ( ) : void

This will empty the Template so that the toString paramater will return null. This is used so that the same Template can be recycled for different tokens.

EnsureCapacity ( int min ) : void

This ensure that there is enough space in the buffer to allow for more characters to be added. If the buffer is already larger than min then the buffer will not be expanded at all.

Length ( ) : int

This will return the number of bytes that have been appended to the Template. This will return zero after the clear method has been invoked.

Template ( ) : System

Constructor for Template. The default Template stores 16 characters before a resize is needed to append extra characters.

Template ( int size ) : System

This creates a Template with a specific default size. The buffer will be created the with the length specified. The Template can grow to accomodate a collection of characters larger the the size spacified.

ToString ( ) : String

This will return the characters that have been appended to the Template as a String object. If the String object has been created before then a cached String object will be returned. This method will return null after clear is invoked.

메소드 상세

Append() 공개 메소드

This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.
public Append ( String str ) : void
str String /// the String to be appended to this ///
리턴 void

Append() 공개 메소드

This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.
public Append ( String str, int off, int len ) : void
str String /// the String to be appended to this ///
off int /// the read offset for the String ///
len int /// the number of characters to append to this ///
리턴 void

Append() 공개 메소드

This will add a Template to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large Template objects.
public Append ( Template text ) : void
text Template /// the Template to be appended ///
리턴 void

Append() 공개 메소드

This will add a Template to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large Template objects.
public Append ( Template text, int off, int len ) : void
text Template /// the Template to be appended ///
off int /// the read offset for the Template ///
len int /// the number of characters to append to this ///
리턴 void

Append() 공개 메소드

This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate more characters.
public Append ( char c ) : void
c char /// the char to be appended ///
리턴 void

Append() 공개 메소드

This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large char arrays.
public Append ( char c, int off, int len ) : void
c char /// the char array to be appended to this ///
off int /// the read offset for the array ///
len int /// the number of characters to append to this ///
리턴 void

Clear() 공개 메소드

This will empty the Template so that the toString paramater will return null. This is used so that the same Template can be recycled for different tokens.
public Clear ( ) : void
리턴 void

EnsureCapacity() 공개 메소드

This ensure that there is enough space in the buffer to allow for more characters to be added. If the buffer is already larger than min then the buffer will not be expanded at all.
public EnsureCapacity ( int min ) : void
min int /// the minimum size needed for this buffer ///
리턴 void

Length() 공개 메소드

This will return the number of bytes that have been appended to the Template. This will return zero after the clear method has been invoked.
public Length ( ) : int
리턴 int

Template() 공개 메소드

Constructor for Template. The default Template stores 16 characters before a resize is needed to append extra characters.
public Template ( ) : System
리턴 System

Template() 공개 메소드

This creates a Template with a specific default size. The buffer will be created the with the length specified. The Template can grow to accomodate a collection of characters larger the the size spacified.
public Template ( int size ) : System
size int /// initial size of this Template ///
리턴 System

ToString() 공개 메소드

This will return the characters that have been appended to the Template as a String object. If the String object has been created before then a cached String object will be returned. This method will return null after clear is invoked.
public ToString ( ) : String
리턴 String

프로퍼티 상세

buf 보호되어 있는 프로퍼티

The characters that this buffer has accumulated.
protected char[] buf
리턴 char[]

cache 보호되어 있는 프로퍼티

This is used to quicken toString.
protected String cache
리턴 String

count 보호되어 있는 프로퍼티

This is the number of characters this has stored.
protected int count
리턴 int