org.opencms.frontend.templateone
Class CmsTemplateLink

java.lang.Object
  extended by org.opencms.frontend.templateone.CmsTemplateLink
All Implemented Interfaces:
java.lang.Comparable

public class CmsTemplateLink
extends java.lang.Object
implements java.lang.Comparable

Represents a single link to be used to display on the page.

These objects are used for the head link row creation of template one.

Since:
6.0.0

Constructor Summary
CmsTemplateLink()
          Creates a new CmsTemplateLink.
CmsTemplateLink(java.lang.String anchor, java.lang.String text, java.lang.String target, int order)
          Creates a new CmsTemplateLink with initialized parameters.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this instance to another given object instance of this class to sort a list of links.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAnchor()
          Returns the link anchor.
 int getOrder()
          Returns the order number of the link.
 java.lang.String getTarget()
          Returns the target of the link.
 java.lang.String getText()
          Returns the displayed link text.
 int hashCode()
           
 void setAnchor(java.lang.String anchor)
          Sets the link anchor.
 void setOrder(int order)
          Sets the order number of the link.
 void setTarget(java.lang.String target)
          Sets the target of the link.
 void setText(java.lang.String text)
          Sets the displayed link text.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsTemplateLink

public CmsTemplateLink()
Creates a new CmsTemplateLink.


CmsTemplateLink

public CmsTemplateLink(java.lang.String anchor,
                       java.lang.String text,
                       java.lang.String target,
                       int order)
Creates a new CmsTemplateLink with initialized parameters.

Parameters:
anchor - the link anchor
text - the text to display for the link
target - the linkt target, can be left empty
order - the order number for sorting link lists
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Compares this instance to another given object instance of this class to sort a list of links.

Use java.util.Collections.sort(List) to sort a list of link objects by their order number ascending.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the other given object instance to compare with
Returns:
the comparison result for the objects

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getAnchor

public java.lang.String getAnchor()
Returns the link anchor.

Returns:
the link anchor

getOrder

public int getOrder()
Returns the order number of the link.

Returns:
the order number of the link

getTarget

public java.lang.String getTarget()
Returns the target of the link.

Returns:
the target of the link

getText

public java.lang.String getText()
Returns the displayed link text.

Returns:
the displayed link text

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

setAnchor

public void setAnchor(java.lang.String anchor)
Sets the link anchor.

Parameters:
anchor - the link anchor

setOrder

public void setOrder(int order)
Sets the order number of the link.

Parameters:
order - the order number of the link

setTarget

public void setTarget(java.lang.String target)
Sets the target of the link.

Parameters:
target - the target of the link

setText

public void setText(java.lang.String text)
Sets the displayed link text.

Parameters:
text - the displayed link text