public class SolutionPattern extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SolutionPattern.ContainmentRelation
A relationship between two solution patterns which affects how they may be composed into new solutions.
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
expirationTime |
protected int |
matchedPatterns |
protected int |
remainingPatterns |
| Modifier | Constructor and Description |
|---|---|
protected |
SolutionPattern(int remainingPatterns,
int matchedPatterns,
long expirationTime) |
|
SolutionPattern(SolutionPattern other)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
static int |
compareExpirationTimes(SolutionPattern s1,
SolutionPattern s2)
Compares the expiration times of two solutions
|
void |
copyFrom(SolutionPattern other)
Overwrites the fields of this solution with those of a given solution.
|
boolean |
disjointWith(SolutionPattern other)
Finds whether this solution is disjoint with another solution
|
boolean |
isComplete()
Finds whether this solution is complete
|
boolean |
isExpired(long now)
Gets the expiration status of this solution
|
static long |
minExpirationTime(SolutionPattern s1,
SolutionPattern s2)
Composes the expiration times of two inputs to produce an expiration time for an output.
|
SolutionPattern.ContainmentRelation |
relateTo(SolutionPattern other)
Finds the containment relation between this solution and another solution
|
void |
setExpirationTime(long expirationTime)
Sets a new expiration time for this solution
|
protected int remainingPatterns
protected int matchedPatterns
protected long expirationTime
protected SolutionPattern(int remainingPatterns,
int matchedPatterns,
long expirationTime)
public SolutionPattern(SolutionPattern other)
other - another solution pattern to copypublic void copyFrom(SolutionPattern other)
other - another solution pattern to copypublic void setExpirationTime(long expirationTime)
expirationTime - an expiration time, in milliseconds since the Unix epoch.
The special value 0 indicates that the solution is valid indefinitely.public boolean isExpired(long now)
now - the current time, in millseconds since the Unix epochpublic boolean isComplete()
public boolean disjointWith(SolutionPattern other)
other - another solutionpublic SolutionPattern.ContainmentRelation relateTo(SolutionPattern other)
other - another solution for comparisonpublic static long minExpirationTime(SolutionPattern s1, SolutionPattern s2)
s1 - a solution patterns2 - a solution patternpublic static int compareExpirationTimes(SolutionPattern s1, SolutionPattern s2)
s1 - a solution patterns2 - a solution patternCopyright © 2016. All Rights Reserved.