de.unibi.techfak.misc
Interface Markable

All Known Implementing Classes:
DoubleMotif, Marker, Motif, MultiMotif, PSPMotif, PSSMotif, RegularExpressionMotif, SequenceMotif

public interface Markable

This interface should be implemented by objects, that can be marked. A mark can be everything, like MARK_DELETED, MARK_TOBEREPLACED. The implementation should occur the way, that for objects with multiple marks the marks should be disjuncted (bitwise OR operation).


Field Summary
static int MARK_BASIC
          The basic mark simple means that the object is marked somehow or that subsequent objects might bear a mark of proper meaning.
static int MARK_DELETED
          The mark, that the object was deleted.
static int MARK_EXP
          The first bit not used for the markers predefined in this class.
static int MARK_MOVED
          The mark, that the object was moved.
static int MARK_REPLACED
          The mark, that the object was replaced.
static int MARK_SELECTED
          This mark means, that the corresponding object, marked so, was somehow selected.
static int MARK_TOBEDELETED
          The mark, that the object is to be deleted.
static int MARK_TOBEMOVED
          The mark, that the object is to be moved.
static int MARK_TOBEREPLACED
          The mark, that the object is to be replaced.
 
Method Summary
 void clearMark()
          The mark of the object is cleared, thus it is not marked anymore.
 void clearMark(int mark)
          Clears a special mark.
 int getMark()
          Gets the complete mark for the object.
 boolean isMarked()
          Tests, whether any mark is set.
 boolean isMarked(int mark)
          Tests a special mark, whether it is set.
 void setMark(int mark)
          Sets a mark for the object.
 

Field Detail

MARK_BASIC

static final int MARK_BASIC
The basic mark simple means that the object is marked somehow or that subsequent objects might bear a mark of proper meaning. This marker has always a value of 1.

See Also:
Constant Field Values

MARK_SELECTED

static final int MARK_SELECTED
This mark means, that the corresponding object, marked so, was somehow selected.

See Also:
Constant Field Values

MARK_TOBEDELETED

static final int MARK_TOBEDELETED
The mark, that the object is to be deleted.

See Also:
Constant Field Values

MARK_DELETED

static final int MARK_DELETED
The mark, that the object was deleted.

See Also:
Constant Field Values

MARK_TOBEREPLACED

static final int MARK_TOBEREPLACED
The mark, that the object is to be replaced.

See Also:
Constant Field Values

MARK_REPLACED

static final int MARK_REPLACED
The mark, that the object was replaced.

See Also:
Constant Field Values

MARK_TOBEMOVED

static final int MARK_TOBEMOVED
The mark, that the object is to be moved.

See Also:
Constant Field Values

MARK_MOVED

static final int MARK_MOVED
The mark, that the object was moved.

See Also:
Constant Field Values

MARK_EXP

static final int MARK_EXP
The first bit not used for the markers predefined in this class. This is actually not a mark, and should never be used as one. It is stronlgy recommended, that markers to be defined by classes implementing this interface should look like
public static final int MARK_XXX = MARK_BASIC<<(MARK_EXP+0);
with ascending numbers replacing the zero in the example.

See Also:
Constant Field Values
Method Detail

setMark

void setMark(int mark)
Sets a mark for the object. The mark is disjuncted (bitwise OR operation) to the existing mark.

Parameters:
mark - The mark to set.

getMark

int getMark()
Gets the complete mark for the object.

Returns:
The complete mark.

clearMark

void clearMark(int mark)
Clears a special mark. Its inversion is conjuncted (bitwise AND operation) to the existing mark.

Parameters:
mark - The mark to be deleted.

clearMark

void clearMark()
The mark of the object is cleared, thus it is not marked anymore. After this, every call to isMarked() and isMarked(int) should return false.

See Also:
isMarked(), isMarked(int)

isMarked

boolean isMarked()
Tests, whether any mark is set.

Returns:
true iff a mark is set, false otherwise.

isMarked

boolean isMarked(int mark)
Tests a special mark, whether it is set.

Parameters:
mark - The mark to be tested.
Returns:
true iff the mark is set, false otherwise.