Package org.apache.flink.cep.nfa
Class DeweyNumber
java.lang.Object
org.apache.flink.cep.nfa.DeweyNumber
- All Implemented Interfaces:
Serializable
Versioning scheme which allows to retrieve dependencies between different versions.
A dewey number consists of a sequence of digits d1.d2.d3. ... .dn. A dewey number v is compatible to v' iff v contains v' as a prefix or if both dewey number differ only in the last digit and the last digit of v is greater than v'.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classATypeSerializerfor theDeweyNumberwhich serves as a version number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddStage()Creates a new dewey number from this such that a 0 is appended as new last digit.booleanstatic DeweyNumberfromString(String deweyNumberString) Creates a dewey number from a string representation.intgetRun()inthashCode()increase()Creates a new dewey number from this such that its last digit is increased by one.increase(int times) Creates a new dewey number from this such that its last digit is increased by the supplied number.booleanisCompatibleWith(DeweyNumber other) Checks whether this dewey number is compatible to the other dewey number.intlength()toString()
-
Constructor Details
-
DeweyNumber
public DeweyNumber(int start) -
DeweyNumber
-
-
Method Details
-
isCompatibleWith
Checks whether this dewey number is compatible to the other dewey number.True iff this contains other as a prefix or iff they differ only in the last digit whereas the last digit of this is greater than the last digit of other.
- Parameters:
other- The other dewey number to check compatibility against- Returns:
- Whether this dewey number is compatible to the other dewey number
-
getRun
public int getRun() -
length
public int length() -
increase
Creates a new dewey number from this such that its last digit is increased by one.- Returns:
- A new dewey number derived from this whose last digit is increased by one
-
increase
Creates a new dewey number from this such that its last digit is increased by the supplied number.- Parameters:
times- how many times to increase the Dewey number- Returns:
- A new dewey number derived from this whose last digit is increased by given number
-
addStage
Creates a new dewey number from this such that a 0 is appended as new last digit.- Returns:
- A new dewey number which contains this as a prefix and has 0 as last digit
-
equals
-
hashCode
public int hashCode() -
toString
-
fromString
Creates a dewey number from a string representation. The input string must be a dot separated string of integers.- Parameters:
deweyNumberString- Dot separated string of integers- Returns:
- Dewey number generated from the given input string
-