Qwylt

java.lang.module.spi.query
Class And

java.lang.Object
  extended by java.lang.module.ModuleQuery
      extended by java.lang.module.spi.query.Binary
          extended by java.lang.module.spi.query.And
All Implemented Interfaces:
java.lang.Iterable<ModuleQuery>, Matcher<ModuleArchive>

public class And
extends Binary

A boolean ModuleQuery that matches if both left and right match.

Since:
Dec 12, 2008
Author:
Bryan Atsatt

Field Summary
 
Fields inherited from class java.lang.module.ModuleQuery
ANY, NONE
 
Constructor Summary
And(ModuleQuery left, ModuleQuery right)
          Constructor.
 
Method Summary
static ModuleQuery create(ModuleQuery q1, ModuleQuery q2, ModuleQuery... qN)
          Returns a ModuleQuery that is the conjunction of two or more queries.
 boolean matches(ModuleArchive target)
          Tests if the specified target matches this instance.
 java.lang.String toString()
          Returns a string representation of this instance.
 
Methods inherited from class java.lang.module.spi.query.Binary
addTo, find, getLeftChild, getRightChild
 
Methods inherited from class java.lang.module.ModuleQuery
addTo, and, and, any, asList, attributeEquals, attributeExists, exports, exportsPackage, exportsPackage, find, findIndexable, instanceOf, iterator, moduleNameAndVersionMatch, moduleNameEquals, not, not, or, or, versionMatches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

And

public And(ModuleQuery left,
           ModuleQuery right)
Constructor.

Parameters:
left - The left ModuleQuery.
right - The right ModuleQuery.
Method Detail

matches

public boolean matches(ModuleArchive target)
Tests if the specified target matches this instance.

Specified by:
matches in interface Matcher<ModuleArchive>
Specified by:
matches in class ModuleQuery
Parameters:
target - The target instance.
Returns:
true if the specified target matches this instance; false otherwise.

create

public static ModuleQuery create(ModuleQuery q1,
                                 ModuleQuery q2,
                                 ModuleQuery... qN)
Returns a ModuleQuery that is the conjunction of two or more queries.

Parameters:
q1 - The first query.
q2 - The second query.
qN - Optional additional query instances.
Returns:
The ModuleQuery object.

toString

public java.lang.String toString()
Returns a string representation of this instance.

Overrides:
toString in class java.lang.Object
Returns:
The string.

Qwylt

Send comments or questions to Bryan Atsatt