Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.template.cache
Class CmsElementVariant  view CmsElementVariant download CmsElementVariant.java

java.lang.Object
  extended bycom.opencms.template.cache.CmsElementVariant

public class CmsElementVariant
extends java.lang.Object

An instance of CmsElementVariant stores a single cached variant for an element. This is the generated output (content) of an element. This cache stores all generated strings of this element and all links to other elements.


Field Summary
(package private)  java.util.Vector m_content
          The content of this variant.
(package private)  java.util.Vector m_dependencies
          The dependencies of this variant.
private  boolean m_exported
          Marker that indicates if this variant was exported before.
private  long m_nextTimeout
          The date when this variant must be new generated.
 
Constructor Summary
CmsElementVariant()
          Creates a new empty variant for an element.
 
Method Summary
 void add(byte[] staticContent)
          Adds static content to this variant.
 void add(byte[] staticContent, java.lang.String encoding)
          Adds static content to this variant.
 void add(CmsElementLink elementLink)
          Adds an element-link to this variant.
 void add(CmsMethodLink methodLink)
          Adds an method-link to this variant.
 void add(java.lang.String staticContent)
          Adds static content to this variant.
 void addDependencies(java.util.Vector depVariant)
          Add a dependencies Vector to this.
 java.lang.Object get(int i)
          Returns a peace of this variant.
 java.util.Vector getDependencies()
          Gets the dependencies Vector of this Variant.
 long getNextTimeout()
          Returns the time when this variant has to be new generated.
 boolean isTimeCritical()
          Returns true if this variant has an expiration date.
 void mergeNextTimeout(long timeout)
          Merges the time when this variant has to be new generated.
 void setDependencies(java.util.Vector dependencies)
          Sets the dependencies Vector for this Variant.
 void setExported()
          Sets the marker exported to true.
 int size()
          Get the number of objects in this variant.
 java.lang.String toString()
          Get a string representation of this variant.
 boolean wasExported()
          Returns true if this variant was allready exported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_content

java.util.Vector m_content
The content of this variant. In this vector object of type String and of CmsElementLink can be stored.


m_dependencies

java.util.Vector m_dependencies
The dependencies of this variant. In this vector objects of type String can be stored. These Strings are resources in the vfs or the cos. If one of the resources change this variant is decleared void.


m_nextTimeout

private long m_nextTimeout
The date when this variant must be new generated. Only used if it is not 0.


m_exported

private boolean m_exported
Marker that indicates if this variant was exported before.

Constructor Detail

CmsElementVariant

public CmsElementVariant()
Creates a new empty variant for an element.

Method Detail

add

public void add(java.lang.String staticContent)
Adds static content to this variant.


add

public void add(byte[] staticContent)
Adds static content to this variant.


add

public void add(byte[] staticContent,
                java.lang.String encoding)
Adds static content to this variant.


add

public void add(CmsElementLink elementLink)
Adds an element-link to this variant.


add

public void add(CmsMethodLink methodLink)
Adds an method-link to this variant.


size

public int size()
Get the number of objects in this variant.


get

public java.lang.Object get(int i)
Returns a peace of this variant. It can be of the type String, byte[] or CmsElementLink.


setDependencies

public void setDependencies(java.util.Vector dependencies)
Sets the dependencies Vector for this Variant.


wasExported

public boolean wasExported()
Returns true if this variant was allready exported.


setExported

public void setExported()
Sets the marker exported to true. Used when this variant is created in export modus.


getDependencies

public java.util.Vector getDependencies()
Gets the dependencies Vector of this Variant.


addDependencies

public void addDependencies(java.util.Vector depVariant)
Add a dependencies Vector to this.


toString

public java.lang.String toString()
Get a string representation of this variant.


mergeNextTimeout

public void mergeNextTimeout(long timeout)
Merges the time when this variant has to be new generated. Sets it to the minimum of the old and the new value, whereby 0 don't count.


getNextTimeout

public long getNextTimeout()
Returns the time when this variant has to be new generated.


isTimeCritical

public boolean isTimeCritical()
Returns true if this variant has an expiration date.