|
NeoBio API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--neobio.alignment.Factor
This class is used by FactorSequence to create a linked list of factors of a text as induced by its Lempel-Ziv (LZ78) factorisation.
Each instance of this class represent a string composed of its an ancestor factor's string plus one character, and contains:
FactorSequence
Field Summary | |
protected Factor |
ancestor
A pointer to this factor's ancestor, which represents a prefix of this factor's text. |
protected int |
length
The number of characters of the text represented by this factor. |
protected char |
new_char
The new character of this factor. |
protected Factor |
next
A pointer to the next factor. |
protected int |
serial_number
This factor's serial number, which indicates the order of this factor inside the linked list of factors of a text. |
Constructor Summary | |
Factor()
Creates a new empty Factor . |
|
Factor(Factor ancestor,
int serial_number,
char new_char)
Creates a new Factor instance with the specified serial number and
new character, and pointing to the given ancestor. |
Method Summary | |
Factor |
getAncestor()
Returns this factor's ancestor factor. |
int |
getAncestorSerialNumber()
This method is a shorthand to return the serial number of this factor's ancestor. |
char |
getNewChar()
Returns this factor's new character. |
Factor |
getNext()
Returns this factor's next factor. |
int |
getSerialNumber()
Returns this factor's serial number. |
int |
length()
Returns this factor's length. |
void |
setNext(Factor next)
Sets this factor's next pointer to point to the specified factor.
|
java.lang.String |
toString()
Returns a string representation of the text represented by this factor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Factor ancestor
protected Factor next
protected int serial_number
protected int length
protected char new_char
Constructor Detail |
public Factor()
Factor
. It has no ancestor and no character (both
are set to null
). Its serial number is set to zero as well as its
length.
This constructor is used to initiate the a linked list of factors of a text. Its
next
pointer is initially null
, but it is typically set
to point to the first factor afterwards (with the setNext
method).
setNext(neobio.alignment.Factor)
public Factor(Factor ancestor, int serial_number, char new_char)
Factor
instance with the specified serial number and
new character, and pointing to the given ancestor. Its length is set to its
ancestor's length plus 1.
Its next
pointer is initially null
, but it is
typically set to point to the next factor afterwards (with the setNext
method).
ancestor
- this factor's ancestorserial_number
- this factor's serial numbernew_char
- this factor's new charactersetNext(neobio.alignment.Factor)
Method Detail |
public void setNext(Factor next)
next
pointer to point to the specified factor.
Although the next factor has typically a serial number equal to this factor's
serial number plus 1, no attempt is made to guarantee this rule. This allows
special constructs or a different order in the factorisation.
next
- the factor that will be pointed togetNext()
public Factor getAncestor()
public int getAncestorSerialNumber()
public Factor getNext()
setNext(neobio.alignment.Factor)
public int getSerialNumber()
public int length()
public char getNewChar()
public java.lang.String toString()
toString
in class java.lang.Object
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |