Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implementing issue JPPF-438 - refactored org.jppf.client.Operator:
extracted interface ComparisonOperator, depracated the and made new class in org.jppf.utils that implements the same interface, refactored the code using the old Operator class
- Loading branch information
Showing
54 changed files
with
5,467 additions
and
5,339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/classes/ | ||
/classes/ | ||
/.settings/ |
466 changes: 235 additions & 231 deletions
466
application-template/src/org/jppf/application/template/TemplateApplicationRunner.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,71 @@ | ||
/* | ||
* JPPF. | ||
* Copyright (C) 2005-2017 JPPF Team. | ||
* http://www.jppf.org | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.jppf.client; | ||
|
||
/** | ||
* Enumeration of the possible boolean operators that can be used as a comparison predicates for integer/long values. | ||
* @author Laurent Cohen | ||
*/ | ||
public enum Operator { | ||
/** | ||
* The number of connections is equal to the expected number. | ||
*/ | ||
EQUAL { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual == expected; } | ||
}, | ||
/** | ||
* The number of connections is different from the expected number. | ||
*/ | ||
NOT_EQUAL { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual != expected; } | ||
}, | ||
/** | ||
* The number of connections is at least the expected number. | ||
*/ | ||
AT_LEAST { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual >= expected; } | ||
}, | ||
/** | ||
* The number of connections is at most the expected number. | ||
*/ | ||
AT_MOST { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual <= expected; } | ||
}, | ||
/** | ||
* The number of connections is strictly greater than the expected number. | ||
*/ | ||
MORE_THAN { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual > expected; } | ||
}, | ||
/** | ||
* The number of connections is strictly less than the expected number. | ||
*/ | ||
LESS_THAN { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual < expected; } | ||
}; | ||
|
||
/** | ||
* Evaluate the condition based on the actual and expected number of connections. | ||
* @param actual the actual number of connections. | ||
* @param expected the expected number of connections | ||
* @return true if the condition is matched, false otherwise. | ||
*/ | ||
public abstract boolean evaluate(long actual, long expected); | ||
} | ||
/* | ||
* JPPF. | ||
* Copyright (C) 2005-2017 JPPF Team. | ||
* http://www.jppf.org | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.jppf.client; | ||
|
||
import org.jppf.utils.ComparisonOperator; | ||
|
||
/** | ||
* Enumeration of the possible boolean operators that can be used as a comparison predicates for integer/long values. | ||
* @author Laurent Cohen | ||
* @deprecated use {@link org.jppf.utils.Operator} instead. | ||
*/ | ||
public enum Operator implements ComparisonOperator { | ||
/** | ||
* The number of connections is equal to the expected number. | ||
*/ | ||
EQUAL { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual == expected; } | ||
}, | ||
/** | ||
* The number of connections is different from the expected number. | ||
*/ | ||
NOT_EQUAL { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual != expected; } | ||
}, | ||
/** | ||
* The number of connections is at least the expected number. | ||
*/ | ||
AT_LEAST { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual >= expected; } | ||
}, | ||
/** | ||
* The number of connections is at most the expected number. | ||
*/ | ||
AT_MOST { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual <= expected; } | ||
}, | ||
/** | ||
* The number of connections is strictly greater than the expected number. | ||
*/ | ||
MORE_THAN { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual > expected; } | ||
}, | ||
/** | ||
* The number of connections is strictly less than the expected number. | ||
*/ | ||
LESS_THAN { | ||
@Override | ||
public boolean evaluate(final long actual, final long expected) { return actual < expected; } | ||
}; | ||
} |
Oops, something went wrong.