oracle.jsp.jwcache
Class SectionId

java.lang.Object
  |
  +--oracle.jsp.jwcache.SectionId

public class SectionId
extends java.lang.Object

SectionId is an id of a cache block or a cache section within a certain web page. Within the same web page, there may be multiple cache blocks. Nested cache blocks are allowed.

SectionId is in a form of N.N.N.N, where N is a positive integer. The numbers of levels of integers and dots are corresponding to the nested level of cache block / section.

Actually, the form of section id here is very similar to the way that writers identify sections in technical documents. e.g. "1.", "2.1.", "2.3.1", "3.2".


Constructor Summary
SectionId()
          Simple null constructor of SectionId objects.
SectionId(SectionId oid)
          Copy constructor of SectionId objects.
 
Method Summary
 void inc()
          increment the value of current level of section id by 1.
 void popLevel()
          decrement the levels of the section id by one to represent leaving the current nested level to a less nested level.
 void pushLevel()
          increment the levels of the section id by one to represent one more nested leve of cache block / section.
 java.lang.String toString()
          get the string of the section id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SectionId

public SectionId()
Simple null constructor of SectionId objects. The initial value of the section id object constructed is "1.".

SectionId

public SectionId(SectionId oid)
Copy constructor of SectionId objects.
Method Detail

inc

public void inc()
increment the value of current level of section id by 1.

e.g. "1." will become "2."; "1.3." will become "1.4.".


pushLevel

public void pushLevel()
increment the levels of the section id by one to represent one more nested leve of cache block / section. The initial value of the new added level is 1.

e.g. "1." will become "1.1."; "2.4." will become "2.4.1.".


popLevel

public void popLevel()
decrement the levels of the section id by one to represent leaving the current nested level to a less nested level.

e.g. "1.3" will become "1."; "4.2.3" will become "4.2".

Invoking popLevel() on a single level SectionId will cause an IllegalStateException.


toString

public java.lang.String toString()
get the string of the section id.

e.g. "1.", "2.", "1.4.3", and "2.3.1.5"

Overrides:
toString in class java.lang.Object
Returns:
the string of the section id