And (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.condition, class: And

# Class And

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.tools.ant.taskdefs.condition.And

All Implemented Interfaces:
  `Cloneable, Condition`

public class And extends ConditionBase implements Condition
<and> condition container.

Iterates over all conditions and returns false as soon as one evaluates to false.

Since:
  Ant 1.4

- ## Field Summary

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `And()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `eval()`
  Is this condition true?

  ### Methods inherited from class ConditionBase

  `add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskName`
  Modifier and Type
  Method
  Description
  `void`
  `add(Condition c)`
  Add an arbitrary condition
  `void`
  `addAnd(And a)`
  Add an <and> condition "container".
  `void`
  `addAvailable(Available a)`
  Add an <available> condition.
  `void`
  `addChecksum(Checksum c)`
  Add an <checksum> condition.
  `void`
  `addContains(Contains test)`
  Add a <contains> condition.
  `void`
  `addEquals(Equals e)`
  Add an <equals> condition.
  `void`
  `addFilesMatch(FilesMatch test)`
  Add a <filesmatch> condition.
  `void`
  `addHttp(Http h)`
  Add an <http> condition.
  `void`
  `addIsFalse(IsFalse test)`
  Add a <isfalse> condition.
  `void`
  `addIsFileSelected(IsFileSelected test)`
  Add an <isfileselected> condition.
  `void`
  `addIsReference(IsReference i)`
  Add an <isreference> condition.
  `void`
  `addIsSet(IsSet i)`
  Add an <isset> condition.
  `void`
  `addIsTrue(IsTrue test)`
  Add a <istrue> condition.
  `void`
  `addNot(Not n)`
  Add an <not> condition "container".
  `void`
  `addOr(Or o)`
  Add an <or> condition "container".
  `void`
  `addOs(Os o)`
  Add an <os> condition.
  `void`
  `addSocket(Socket s)`
  Add a <socket> condition.
  `void`
  `addUptodate(UpToDate u)`
  Add an <uptodate> condition.
  `protected int`
  `countConditions()`
  Count the conditions.
  `protected final Enumeration<Condition>`
  `getConditions()`
  Iterate through all conditions.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### And

    public And()

- ## Method Details

  - ### eval

    public boolean eval() throws BuildException
    Description copied from interface: `Condition`
    Is this condition true?
    Specified by:
      `eval` in interface `Condition`
    Returns:
      true if all the contained conditions evaluates to true
    Throws:
      `BuildException` - if an error occurs