Qwylt

java.lang.module.spi.query
Class Or

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

public class Or
extends Binary

A boolean ModuleQuery that matches if either left or right match.

Since:
Dec 12, 2008
Author:
Bryan Atsatt

Field Summary
 
Fields inherited from class java.lang.module.ModuleQuery
ANY, NONE
 
Constructor Summary
Or(ModuleQuery left, ModuleQuery right)
          Constructor.
 
Method Summary
static ModuleQuery create(ModuleQuery q1, ModuleQuery q2, ModuleQuery... qN)
          Returns a ModuleQuery that is the disjunction of two or more queries.
protected
<T extends ModuleQuery>
Indexable<T>
find(Indexable<T> indexable)
          Match this ModuleQuery and any children against the specified Indexable, stopping at the first match.
 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, 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

Or

public Or(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 disjunction 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.

find

protected <T extends ModuleQuery> Indexable<T> find(Indexable<T> indexable)
Match this ModuleQuery and any children against the specified Indexable, stopping at the first match.

Overrides:
find in class Binary
Parameters:
indexable - The indexable to match.
Returns:
The indexable.

Qwylt

Send comments or questions to Bryan Atsatt