org.josql.functions
Class MiscellaneousFunctions
java.lang.Object
   org.josql.functions.AbstractFunctionHandler
org.josql.functions.AbstractFunctionHandler
       org.josql.functions.MiscellaneousFunctions
org.josql.functions.MiscellaneousFunctions
- All Implemented Interfaces: 
- FunctionHandler
- public class MiscellaneousFunctions 
- extends AbstractFunctionHandler
 
 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
HANDLER_ID
public static final String HANDLER_ID
- See Also:
- Constant Field Values
MiscellaneousFunctions
public MiscellaneousFunctions()
now
public Date now(boolean zeroTime)
- Return the current date.
 
- 
- Parameters:
- zeroTime- If set to- truethen the date returned will have it's time fields
                 set to zero.
- Returns:
- A date object.
 
cache
public void cache(List allobjs,
                  com.gentlyweb.utils.Getter get)
           throws QueryExecutionException
- 
- Throws:
- QueryExecutionException
 
cache
public void cache(List allobjs,
                  Expression exp)
           throws QueryExecutionException
- 
- Throws:
- QueryExecutionException
 
abs
public double abs(Number d)
- 
 
random
public int random()
- 
 
random
public int random(Number n)
- 
 
randomDouble
public double randomDouble()
- 
 
saveValue
public Object saveValue(Object saveValueName)
- 
 
savevalue
public Object savevalue(Object saveValueName)
- 
 
save_value
public Object save_value(Object saveValueName)
- 
 
fileExtension
public String fileExtension(Object f)
- 
 
accessor
public Object accessor(Expression oExp,
                       Expression accExp)
                throws Exception
- Call the specified accessor on the object.
 
- 
- Parameters:
- oExp- The expression to use to evaluate to get the object.
- accExp- The expression that is evaluated to get the accessor.
- Returns:
- The value returned from the accessor.
- Throws:
- Exception- If there is something wrong.
 
accessor
public Object accessor(Object o,
                       String acc)
                throws Exception
- Call the specified accessor on the object.
 
- 
- Parameters:
- o- The object to call the accessor on.
- acc- The accessor.
- Returns:
- The value returned from the accessor.
- Throws:
- Exception- If there is something wrong.
 
ifThen
public Object ifThen(Expression ifcond,
                     Expression thenVal)
              throws QueryExecutionException
- 
- Throws:
- QueryExecutionException
 
ifThenElse
public Object ifThenElse(Expression ifcond,
                         Expression thenVal,
                         Expression elseVal)
                  throws QueryExecutionException
- 
- Throws:
- QueryExecutionException
 
eval
public Object eval(Expression exp)
            throws QueryExecutionException
- 
- Throws:
- QueryExecutionException
 
instanceOf
public Boolean instanceOf(Expression obj,
                          Expression clazz)
                   throws QueryExecutionException
- Evaluates the type expression to produce a object whose type
 should be compared against the class gained from evaluation of the 
 clazz expression.
 In effect the following is performed:
 
   obj.getValue (q.getCurrentObject (), q)
     instanceof clazz.getValue (q.getCurrentObject (), q).getClass ()
 
 This is really just a thin wrapper around Class.isInstance(Object).
 
 
- 
- Parameters:
- obj- The expression that represents the object to
            against.
- clazz- The expression that represents the class of the type
              to compare against.
- Throws:
- QueryExecutionException- If either of the expressions can't
         be evaluated.
 
 Copyright © 2008 Gary Bentley. All Rights Reserved.
  Copyright © 2008 Gary Bentley. All Rights Reserved.