gov.bnl.star.offline.scheduler.dataset.datasetManipulators
Class DropDuplicateRegX

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.dataset.datasetManipulators.DropDuplicateRegX
All Implemented Interfaces:
DatasetManipulator

public class DropDuplicateRegX
extends java.lang.Object
implements DatasetManipulator

A dataset manipulator used to drop entries with matching regular expression capture groups. This class is a composite between SortByRegX and DropDuplicatesForSortedList.

Author:
lbhajdu

Constructor Summary
DropDuplicateRegX(java.lang.String regX)
          Creates a new instance of DropDuplicateRegX
 
Method Summary
 void addPreferredCopyRegx(java.lang.String preference, java.lang.String RegX)
          When more then one file is found matching a regular expression capture group, normally the first one is kept.
 void modify(Dataset dataset, Request request)
          Used to pass the dataset to the dataset manipulator Note: This DatasetManipulator -will- reorder the order of entries
 boolean requirementsSatisfied()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropDuplicateRegX

public DropDuplicateRegX(java.lang.String regX)
Creates a new instance of DropDuplicateRegX

Parameters:
regX - A regular expression capture group. If mroe then one entry matches the capture group, only one one copy will be kept, all other will be dropted.
Method Detail

modify

public void modify(Dataset dataset,
                   Request request)
Used to pass the dataset to the dataset manipulator Note: This DatasetManipulator -will- reorder the order of entries

Specified by:
modify in interface DatasetManipulator
Parameters:
dataset - The dataset to be modifyed
request - The request object of the current request for with will use the dataset

addPreferredCopyRegx

public void addPreferredCopyRegx(java.lang.String preference,
                                 java.lang.String RegX)
When more then one file is found matching a regular expression capture group, normally the first one is kept. This behavior can be modified so as to rank the copies and keep the best one. Example: anything starting with .big. gets a higher ranking then anything starting with .small.: addPreferredCopyRegx(.A.,.^big.*$.); addPreferredCopyRegx(.B.,.^small.*$.); Note that any entry not starting with .big. or .small. will get an even lower rating and is therefore lest likely to be picked.

Parameters:
preference - A string that will be alphabetically sorted to determine the preference. .A. has a higher rank then .Z..
Regx - A regular expression the string must match in order to be assigned this ranking.

requirementsSatisfied

public boolean requirementsSatisfied()
Specified by:
requirementsSatisfied in interface DatasetManipulator


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.