## org.biojava.bio
Class PropertyConstraint.And

    java.lang.Object
      org.biojava.bio.PropertyConstraint.And

All Implemented Interfaces:
  PropertyConstraint

Enclosing interface:
  PropertyConstraint

    public static class PropertyConstraint.And

extends java.lang.Object
implements PropertyConstraint

A property constraint that accpepts items iff they are accepted by both child constraints. This effectively matches the intersection of the items matched by the two constraints.

Author:
  Matthew Pocock
For advanced users:
  Use this to combine multiple constraints. You can make one or both of the children And instances if you need a tighter intersection.

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.bio.PropertyConstraint
`PropertyConstraint.And, PropertyConstraint.ByAnnotationType, PropertyConstraint.ByClass, PropertyConstraint.Enumeration, PropertyConstraint.ExactValue, PropertyConstraint.Or`

Field Summary

Fields inherited from interface org.biojava.bio.PropertyConstraint
`ANY, NONE`

Constructor Summary
`PropertyConstraint.And(PropertyConstraint c1, PropertyConstraint c2)` Create a new `And` from two child constraints.

Method Summary
`boolean` `accept(java.lang.Object object)` `accept` returns true if the value fulfills the constraint.
`PropertyConstraint` `getChild1()` Get the first child PropertyConstraint.
`PropertyConstraint` `getChild2()` Get the seccond child PropertyConstraint.
`boolean` `subConstraintOf(PropertyConstraint pc)` `subConstraintOf` returns true if the constraint is a sub-constraint.
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PropertyConstraint.And

    public PropertyConstraint.And(PropertyConstraint c1,
                                  PropertyConstraint c2)

  Create a new `And` from two child constraints.

  Parameters:
    `c1` - the first child
    `c2` - the seccond child
  For general use:

Method Detail

### getChild1

    public PropertyConstraint getChild1()

  Get the first child PropertyConstraint.

  Returns:
    the first child PropertyConstraint
  For advanced users:
    Introspect this constraint

### getChild2

    public PropertyConstraint getChild2()

  Get the seccond child PropertyConstraint.

  Returns:
    the seccond child PropertyConstraint
  For advanced users:
    Introspect this constraint

### accept

    public boolean accept(java.lang.Object object)

  Description copied from interface: `PropertyConstraint`
  `accept` returns true if the value fulfills the constraint.

  Specified by:
    `accept` in interface `PropertyConstraint`
  Parameters:
    `object` - an `Object` to check.
  Returns:
    a `boolean`.

### subConstraintOf

    public boolean subConstraintOf(PropertyConstraint pc)

  Description copied from interface: `PropertyConstraint`

  `subConstraintOf` returns true if the constraint is a sub-constraint.

  A pair of constraints super and sub are in a superConstraint/subConstraint relationship if every object accepted by sub is also accepted by super. To put it another way, if instanceOf was used as a set-membership indicator function over some set of objects, then the set produced by super would be a superset of that produced by sub.

  It is not expected that constraints will neccesarily maintain references to super/sub types. It will be more usual to infer this relationship by introspecting the constraints themselves. For example, `PropertyConstraint.ByClass` will infer subConstraintOf by looking at the possible class of all items matching subConstraint.

  Specified by:
    `subConstraintOf` in interface `PropertyConstraint`
  Parameters:
    `pc` - a `PropertyConstraint` to check.
  Returns:
    a `boolean`.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`