Method | Description | |
---|---|---|
Cache ( int size ) : System |
Constructor for the
|
|
Get ( int index ) : String |
This method is used to retrieve an indent from the given position. This allows the indenter to use the cache as a stack, by increasing and decreasing the index as required.
|
|
Resize ( int size ) : void |
Should the number of indents to be cache grows larger than the default initial size then this will increase the size of the cache. This ensures that the indenter can handle an arbitrary number of indents for a given output.
|
|
Set ( int index, String text ) : void |
This method is used to add the specified indent on to the cache. The index allows the cache to act as a stack, when the index is specified it can be used to retrieve the same indent using that index.
|
|
Size ( ) : int |
This method is used to retrieve the number of indents that have been added to the cache. This is used to determine if an indent request is the first.
|
public Cache ( int size ) : System | ||
size | int | /// the initial number of entries in the cache /// |
return | System |
public Get ( int index ) : String | ||
index | int | /// the position to retrieve the indent from /// |
return | String |
public Resize ( int size ) : void | ||
size | int | /// this is the size to expand the cache to /// |
return | void |
public Set ( int index, String text ) : void | ||
index | int | /// this is the position to add the index to /// |
text | String | /// this is the indent to add to the position /// |
return | void |