XPUSP - Home

br.usp.ime.xpusp.util
Class XpuspInfo

java.lang.Object
  |
  +--br.usp.ime.xpusp.util.XpuspInfo
All Implemented Interfaces:
org.apache.turbine.services.pull.ApplicationTool, ArrayBuilder

public class XpuspInfo
extends java.lang.Object
implements ArrayBuilder, org.apache.turbine.services.pull.ApplicationTool

This is a class used as a request tool. It is present on all templates and can be referenced by $xpuspinfo

SourceForge LogoSource Forge Info
CVS File :XpuspInfo.java
User :krico
Version :1.11
Date :2002/06/08 22:24:21


Field Summary
(package private)  java.lang.String cvsLink
           
static java.lang.String CVSURL
           
(package private)  org.apache.turbine.util.RunData data
           
 
Constructor Summary
XpuspInfo()
           
 
Method Summary
 ArrayBuilder arrayAdd(boolean o)
           
 ArrayBuilder arrayAdd(byte o)
           
 ArrayBuilder arrayAdd(char o)
           
 ArrayBuilder arrayAdd(double o)
           
 ArrayBuilder arrayAdd(float o)
           
 ArrayBuilder arrayAdd(int o)
           
 ArrayBuilder arrayAdd(long o)
           
 ArrayBuilder arrayAdd(java.lang.Object o)
           
 ArrayBuilder arrayAdd(short o)
           
 boolean containsDefaultCapability(java.util.Vector defaultcapabilities, Discipline d, Department dpt)
          Checks weather the defaultcapabilities Vector contains a DefaultCapability with the discipline and department specified
 java.lang.String format(Period p, java.lang.String sep)
          Print a Localized formated string representing this period.
 java.lang.String formatDow(Period p)
          Print a Localized formated string representing this period's Day of Week.
 java.lang.String getCvsLink()
          Get the value of cvsLink.
 void init(java.lang.Object data)
          This is called by the system to initialize this tool as a request tool
private  void parseSource(java.lang.String rev, java.lang.String text)
           
 void refresh()
          called by the system to refresh it
 void setCvsLink(java.lang.String v)
          Set the value of cvsLink.
 void setCvsSource(java.lang.String revision, java.lang.String source)
          Setting this attribute properly will generate the cvsLink attribute
 java.lang.Object[] toArray()
          Example:
 java.util.Vector toVector()
           
 java.lang.String trim(java.lang.String str, int max)
          Print the string str with maximum length max
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CVSURL

public static java.lang.String CVSURL

cvsLink

java.lang.String cvsLink

data

org.apache.turbine.util.RunData data
Constructor Detail

XpuspInfo

public XpuspInfo()
Method Detail

init

public void init(java.lang.Object data)
This is called by the system to initialize this tool as a request tool
Specified by:
init in interface org.apache.turbine.services.pull.ApplicationTool

refresh

public void refresh()
called by the system to refresh it
Specified by:
refresh in interface org.apache.turbine.services.pull.ApplicationTool

containsDefaultCapability

public boolean containsDefaultCapability(java.util.Vector defaultcapabilities,
                                         Discipline d,
                                         Department dpt)
                                  throws java.lang.Exception
Checks weather the defaultcapabilities Vector contains a DefaultCapability with the discipline and department specified
Returns:
true if it contains it

getCvsLink

public java.lang.String getCvsLink()
Get the value of cvsLink.
Returns:
value of cvsLink.

setCvsLink

public void setCvsLink(java.lang.String v)
Set the value of cvsLink.
Parameters:
v - Value to assign to cvsLink.

setCvsSource

public void setCvsSource(java.lang.String revision,
                         java.lang.String source)
Setting this attribute properly will generate the cvsLink attribute
Parameters:
revision - - a cvs revision tag, like this one $Revision: 1.11 $
source - - a cvs source tag, like this one $Source: /cvsroot/xpusp/xpusp-turbine/WEB-INF/src/java/br/usp/ime/xpusp/util/XpuspInfo.java,v $

parseSource

private void parseSource(java.lang.String rev,
                         java.lang.String text)
                  throws java.lang.Exception

trim

public java.lang.String trim(java.lang.String str,
                             int max)
Print the string str with maximum length max
Returns:
the string str if is is not longer than max, otherwise return max-2 chars of the string appended with ".."

format

public java.lang.String format(Period p,
                               java.lang.String sep)
Print a Localized formated string representing this period. It uses tha locale in RunData passed on init to localize it.
Parameters:
p - The period
sep - The string used to separate both dates (start/end)

formatDow

public java.lang.String formatDow(Period p)
Print a Localized formated string representing this period's Day of Week. It uses tha locale in RunData passed on init to localize it.

arrayAdd

public ArrayBuilder arrayAdd(java.lang.Object o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(boolean o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(char o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(byte o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(short o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(int o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(long o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(float o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

arrayAdd

public ArrayBuilder arrayAdd(double o)
Specified by:
arrayAdd in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
the current ArrayBuilder with the o added to it

toArray

public java.lang.Object[] toArray()
Description copied from interface: ArrayBuilder
Example:
 ArrayBuilder ab = ...;
 ab.arrayAdd(1).arrayAdd("Test").toArray();
 //returns
 {new Integer(1), "Test"}
 
Specified by:
toArray in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
an Object[] with all the Objects and primitives added to the ArrayBuilder via arrayAdd

toVector

public java.util.Vector toVector()
Specified by:
toVector in interface ArrayBuilder
Following copied from interface: br.usp.ime.xpusp.util.ArrayBuilder
Returns:
a Vector with all the Objects and primitives added to the ArrayBuidler via arrayAdd
See Also:
ArrayBuilder.toArray()

XPUSP - Home