Save This Page
Home » apache-ant-1.8.1 » » ant » types » selectors » [javadoc | source]
public class: MajoritySelector [javadoc | source]

All Implemented Interfaces:
    SelectorContainer, FileSelector, Cloneable

This selector is here just to shake up your thinking a bit. Don't get too caught up in boolean, there are other ways you can evaluate a collection of selectors. This one takes a vote of the selectors it contains, and majority wins. You could also have an "all-but-one" selector, a "weighted-average" selector, and so on. These are left as exercises for the reader (as are the usecases where this would be necessary).
Fields inherited from
ref,  checked
Fields inherited from
project,  location,  description
 public MajoritySelector() 
Method from Summary:
isSelected,   setAllowtie,   toString
Methods from
add,   addAnd,   addContains,   addContainsRegexp,   addCustom,   addDate,   addDepend,   addDepth,   addDifferent,   addFilename,   addMajority,   addModified,   addNone,   addNot,   addOr,   addPresent,   addReadable,   addSelector,   addSize,   addType,   addWritable,   appendSelector,   dieOnCircularReference,   getSelectors,   hasSelectors,   isSelected,   selectorCount,   selectorElements,   toString,   validate
Methods from
getError,   isSelected,   setError,   validate,   verifySettings
Methods from
checkAttributesAllowed,   checkChildrenAllowed,   circularReference,   clone,   dieOnCircularReference,   dieOnCircularReference,   dieOnCircularReference,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getDataTypeName,   getRefid,   invokeCircularReferenceCheck,   isChecked,   isReference,   noChildrenAllowed,   pushAndInvokeCircularReferenceCheck,   setChecked,   setRefid,   toString,   tooManyAttributes
Methods from
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from Detail:
 public boolean isSelected(File basedir,
    String filename,
    File file) 
    Returns true (the file is selected) if most of the other selectors agree. In case of a tie, go by the allowtie setting. That defaults to true, meaning in case of a tie, the file is selected.
 public  void setAllowtie(boolean tiebreaker) 
    A attribute to specify what will happen if number of yes votes is the same as the number of no votes defaults to true
 public String toString()