public class BinaryWord
extends java.lang.Object
Arc
and the schedule of the Vertex
.Arc
,
Vertex
,
SMGArcMarking
,
SMGVertexSchedule
Constructor and Description |
---|
BinaryWord()
To build an empty word.
|
BinaryWord(java.lang.Boolean withToken)
To build a word with a single bit.
|
BinaryWord(int value,
int size)
Create a binary word where the decimal value is given by @param value and
the size is given by @param size.
|
BinaryWord(java.lang.String word)
To build the word that is given as a String.
|
Modifier and Type | Method and Description |
---|---|
void |
addAtBegin(java.lang.Boolean value)
To add a bit at the begin of the word (on the left hand side).
|
void |
addAtEnd(java.lang.Boolean value)
To add a bit at the end of the word (on the right hand side).
|
void |
addToListeners(BinaryWordListener listener)
To add a listener to the list of listeners.
|
BinaryWord |
clone()
To clone the binary word.
|
BinaryWord |
complement()
To get the complement of the word.
|
boolean |
contains(boolean b)
To check whether the word contains at least one bit with the value of b.
|
boolean |
equals(java.lang.Object word2)
It test whether words is an instance of BinaryWord.
|
static int |
getAlpha(int k,
int p)
To get the value alpha.
|
int |
getNBofTrueValue()
To get the number of true value in the word
|
static BinaryWord |
getTheMaxBalancedBinaryWord(int k,
int p)
Generate the maximal balanced binary word of length p containing k true value.
|
static BinaryWord |
getTheMinBalancedBinaryWord(int k,
int p)
Generate the minimal balanced binary word of length p containing k true value.
|
boolean |
getValue(int index)
To get the i th value of the word.
|
int |
intValue()
Return the value of the word in base 10.
|
boolean |
isInferiorTo(BinaryWord word2)
To check whether this is inferior to word2
|
boolean |
isSuperiorTo(BinaryWord word2)
To check whether this is superior to word2
|
void |
removeLast()
To remove the last element of the word
|
BinaryWord |
rotate(int indexTowardRight)
To rotate the word toward right.
|
int |
size()
To get the size of the word.
|
BinaryWord |
subVector(int startIndex)
To get a suffix of the word starting at the index given in parameter.
|
BinaryWord |
subVector(int startIndex,
int endIndex)
To get a factor of the word starting and terminating at the index given in parameters.
|
java.lang.String |
toString()
To get the binary word as a String.
|
@API public BinaryWord()
@API public BinaryWord(java.lang.Boolean withToken)
withToken
- the value of the bit@API public BinaryWord(java.lang.String word)
word
- the word as a String.@API public BinaryWord(int value, int size) throws MalformedBinaryWordException
value
- the value in base 10 of he binary wordsize
- The number of bits of the resulting wordMalformedBinaryWordException
@API public BinaryWord clone()
clone
in class java.lang.Object
@API public java.lang.String toString()
toString
in class java.lang.Object
@API public void addToListeners(BinaryWordListener listener)
listener
- the listener to add@API public void addAtBegin(java.lang.Boolean value)
value
- the bit to add@API public void addAtEnd(java.lang.Boolean value)
value
- the bit to add@API public void removeLast()
@API public boolean getValue(int index)
index
- the index i@API public int size()
@API public int getNBofTrueValue()
@API public BinaryWord subVector(int startIndex, int endIndex)
startIndex
- the starting indexendIndex
- the terminating index@API public BinaryWord subVector(int startIndex)
startIndex
- the starting index@API public boolean contains(boolean b)
b
- the value to test@API public BinaryWord rotate(int indexTowardRight)
indexTowardRight
- @API public static int getAlpha(int k, int p)
-alpha*k <==> 1 mod p.
k
- the periodicityp
- the period@API public boolean isInferiorTo(BinaryWord word2)
word2
- @API public boolean isSuperiorTo(BinaryWord word2)
word2
- @API public boolean equals(java.lang.Object word2)
equals
in class java.lang.Object
@API public int intValue()
@API public BinaryWord complement()
@API public static BinaryWord getTheMinBalancedBinaryWord(int k, int p)
k
- the periodicityp
- the period@API public static BinaryWord getTheMaxBalancedBinaryWord(int k, int p)
k
- the periodicityp
- the period