org.mmbase.module.builders
Class DayMarkers

java.lang.Object
  |
  +--org.mmbase.module.core.MMTable
        |
        +--org.mmbase.module.core.MMObjectBuilder
              |
              +--org.mmbase.module.builders.DayMarkers

public class DayMarkers
extends MMObjectBuilder

Version:
$Id: DayMarkers.java,v 1.20 2001/04/25 15:17:35 daniel Exp $
Author:
Daniel Ockeloen,Rico Jansen

Fields inherited from class org.mmbase.module.core.MMObjectBuilder
broadcastChanges, className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual
 
Fields inherited from class org.mmbase.module.core.MMTable
mmb, tableName
 
Constructor Summary
DayMarkers()
           
 
Method Summary
 int getAge(MMObjectNode node)
          Returns the age, in days, of a node.
 int getDayCount()
          The current day count, that is, the time in days, of today.
 int getDayCountAge(int daysold)
          Given an age, this function returns a mark, _not a day count_.
 int getDayCountByObject(int number)
           
 int getMonthsByDayCount(int daycount)
           
 boolean init()
          Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called.
 void probe()
          This gets called every hour to see if the day has past.
 java.lang.String replace(scanpage sp, java.util.StringTokenizer command)
          Scan.
 
Methods inherited from class org.mmbase.module.core.MMObjectBuilder
addField, addLocalObserver, addRemoteObserver, buildSet, checkAddTmpField, commit, convertMMNode2SQL, count, create, createAlias, created, debug, deleteNodeCache, executeFunction, fieldLocalChanged, getAliasedNode, getCacheNumbers, getCacheSize, getCacheSize, getClassName, getDBByte, getDBKey, getDBState, getDBText, getDBType, getDefaultTeaser, getDefaultUrl, getDescription, getDescriptions, getDutchSName, getEditFields, getField, getFieldNames, getFields, getFullTableName, getFunctionParameters, getGUIIndicator, getGUIIndicator, getHardNode, getHTML, getInitParameter, getInitParameters, getList, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNode, getNode, getNodeType, getNumberFromName, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getSortedFields, getSortedListFields, getTableName, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, getXMLSetup, hostname_function, init_obj2type, insert, insert, insertDone, isNodeCached, isVirtual, isXMLConfig, nodeLocalChanged, nodeRemoteChanged, preCommit, preEdit, process, putTmpNode, readSearchResults, removeField, removeNode, removeRelations, removeTmpNode, search, search, search, searchIn, searchIn, searchIn, searchNumbers, searchVector, searchVector, searchVector, searchVector, searchVectorIn, searchVectorIn, searchVectorIn, searchVectorIn, searchWithWhere, sendFieldChangeSignal, setClassName, setDBLayout_xml, setDBLayout, setDebug, setDefaults, setDescription, setDescriptions, setDutchSName, setInitParameter, setMaintainer, setMMBase, setPluralNames, setSearchAge, setSingularNames, setTableName, setValue, setVersion, setXmlConfig, setXMLPath, setXMLValues, signalNewObject, testValidData, toXML, waitUntilNodeChanged, wrap
 
Methods inherited from class org.mmbase.module.core.MMTable
size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DayMarkers

public DayMarkers()
Method Detail

init

public boolean init()
Description copied from class: MMObjectBuilder
Initializes this builder The property 'mmb' needs to be set for the builder before this method can be called. The method retrieves data from the TypeDef builder, or adds data to thet builder if the current builder si not yet registrered.
Overrides:
init in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Returns:
Always true.
See Also:
MMObjectBuilder.create()

probe

public void probe()
This gets called every hour to see if the day has past.

getAge

public int getAge(MMObjectNode node)
Returns the age, in days, of a node. So, this does the inverse of most methods in this class. It converts a node number (which is like a mark) to a day.
Overrides:
getAge in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
node - The node whose age to determine
Returns:
the age in days, or 0 if unknown (daymarks builder not present)

getDayCount

public int getDayCount()
The current day count, that is, the time in days, of today.

getDayCountAge

public int getDayCountAge(int daysold)
Given an age, this function returns a mark, _not a day count_.
Parameters:
daysold - a time in days ago.

replace

public java.lang.String replace(scanpage sp,
                                java.util.StringTokenizer command)
Scan. Knows the tokens, COUNT, COUNTAGE, COUNTMONTH, COUNTPREVMONTH, COUNTNEXTMONTH etc.
Overrides:
replace in class MMObjectBuilder
Following copied from class: org.mmbase.module.core.MMObjectBuilder
Parameters:
sp - The scanpage (containing http and user info) that calls the function
tok - a list of strings that describe the (sub)command to execute
Returns:
the result value as a String

getDayCountByObject

public int getDayCountByObject(int number)

getMonthsByDayCount

public int getMonthsByDayCount(int daycount)


MMBase 2001