Package org.apache.flink.cep.nfa
Class DeweyNumber
- java.lang.Object
-
- org.apache.flink.cep.nfa.DeweyNumber
-
- All Implemented Interfaces:
Serializable
public class DeweyNumber extends Object implements 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeweyNumber.DeweyNumberSerializerATypeSerializerfor theDeweyNumberwhich serves as a version number.
-
Constructor Summary
Constructors Constructor Description DeweyNumber(int start)DeweyNumber(DeweyNumber number)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DeweyNumberaddStage()Creates a new dewey number from this such that a 0 is appended as new last digit.booleanequals(Object obj)static DeweyNumberfromString(String deweyNumberString)Creates a dewey number from a string representation.intgetRun()inthashCode()DeweyNumberincrease()Creates a new dewey number from this such that its last digit is increased by one.DeweyNumberincrease(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()StringtoString()
-
-
-
Constructor Detail
-
DeweyNumber
public DeweyNumber(int start)
-
DeweyNumber
public DeweyNumber(DeweyNumber number)
-
-
Method Detail
-
isCompatibleWith
public boolean isCompatibleWith(DeweyNumber other)
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
public DeweyNumber 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
public DeweyNumber increase(int times)
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
public DeweyNumber 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
-
fromString
public static DeweyNumber fromString(String deweyNumberString)
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
-
-