lrs.visitor
Class SkipLeadMods

java.lang.Object
  extended by lrs.visitor.SkipLeadMods
All Implemented Interfaces:
IAlgo

public class SkipLeadMods
extends java.lang.Object
implements IAlgo

An algortihm on a LRStruct that will skip over all the leading multiples of the supplied value. The return value is the sub-list (a LRStruct) whose leading term is the first occurence of a non-multiple of the given value. Here the supplied value is assumed to be an Integer.


Field Summary
static SkipLeadMods Singleton
           
 
Constructor Summary
private SkipLeadMods()
           
 
Method Summary
 java.lang.Object emptyCase(LRStruct host, java.lang.Object... param)
          No multiples to be found in the empty list, so the list is returned.
 java.lang.Object nonEmptyCase(LRStruct host, java.lang.Object... param)
          Recursively searches for the first non-multiple of the given value (in param).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static SkipLeadMods Singleton
Constructor Detail

SkipLeadMods

private SkipLeadMods()
Method Detail

emptyCase

public java.lang.Object emptyCase(LRStruct host,
                                  java.lang.Object... param)
No multiples to be found in the empty list, so the list is returned.

Specified by:
emptyCase in interface IAlgo
Parameters:
host -
param -
Returns:

nonEmptyCase

public java.lang.Object nonEmptyCase(LRStruct host,
                                     java.lang.Object... param)
Recursively searches for the first non-multiple of the given value (in param).

Specified by:
nonEmptyCase in interface IAlgo
Parameters:
host -
param -
Returns: