|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IClone
Public interface for all clone data objects.
This interface lists all methods which are available to all CPC plug-ins and 3rd party contributions.
Additional methods are defined by more specific sub-interfaces which
belong to individual CPC plugins and are to be considered private.
Any CPC plugin other than the one designated in the sub-interface API must not access
such methods.
Any implementation needs to implement ICloneInterfaces
.
Implementing only IClone
is not enough!
ICloneInterfaces
,
ICloneFactoryProvider
Nested Class Summary | |
---|---|
static class |
IClone.State
Specifies the state of a clone. |
Field Summary | |
---|---|
static java.lang.String |
PERSISTENCE_CLASS_IDENTIFIER
IStatefulObject persistence class identifier, value: "clone" |
Fields inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneObject |
---|
PERSISTENCE_OBJECT_IDENTIFIER |
Method Summary | |
---|---|
void |
addClassification(java.lang.String classification)
Adds the given classification string to this clone. |
int |
compareTo(IClone o)
This is a somewhat tricky implementation of compareTo(). |
java.util.Collection<java.lang.String> |
getClassifications()
Returns a collection with all classifications of this clone. |
IClone.State |
getCloneState()
Retrieves the IClone.State of this clone instance. |
java.util.Date |
getCloneStateChangeDate()
Retrieves the date of the last modification to this clone's IClone.State . |
java.util.Date |
getCloneStateDismissalDate()
Retrieves the date of the last dismissal of a cpc notification for this clone by the user. |
java.lang.String |
getCloneStateMessage()
Retrieves an optional message which contains the rationale for the current clone state of this clone. |
double |
getCloneStateWeight()
Retrieves the weight of the current clone state of this clone. |
java.lang.String |
getContent()
Retrieves the current content of this clone. |
java.util.Date |
getCreationDate()
Retrieves the creation date of this clone. |
java.lang.String |
getCreator()
Retrieves the creator (username) of this clone. |
int |
getEndOffset()
Returns the offset of the last character which is still part of this clone. |
java.lang.String |
getFileUuid()
Retrieves the UUID for the clone file in which this clone is located. |
java.lang.String |
getGroupUuid()
Retrieves the UUID of the clone group which this clone belongs to. |
int |
getLength()
Retrieves the length of this clone. |
java.util.Date |
getModificationDate()
Retrieves the date of the last modification to this clone's content. |
int |
getOffset()
Retrieves the offset of the first character which is part of this clone. |
java.lang.String |
getOriginalContent()
Retrieves the original content of this clone at the time of its creation. |
java.lang.String |
getOriginUuid()
Retrieves the origin clone from which this clone was copied. |
boolean |
hasClassification(java.lang.String classification)
Checks whether this clone possesses the given classification. |
boolean |
intersects(IClone clone)
Checks whether two clone positions intersect. |
boolean |
intersects(int offset,
int length)
Checks whether this clone intersect with the given range. |
boolean |
isTransient()
Whether this clone instance should be persisted or not. |
void |
removeClassification(java.lang.String classification)
Removes the given classification from this clone. |
void |
setCloneState(IClone.State cloneState,
double weight,
java.lang.String message)
Sets the IClone.State of this clone instance. |
void |
setGroupUuid(java.lang.String groupUuid)
Sets the UUID of the clone group which this clone belongs to. |
void |
setLength(int length)
Sets the length of this clone. |
void |
setOffset(int offset)
Sets the offset of the first character which is part of this clone. |
void |
setOriginUuid(java.lang.String originUuid)
Sets the origin clone for this clone. |
void |
setTransient(boolean _transient)
Specifies whether this clone instance should be persisted or not. |
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneObject |
---|
addExtension, clone, equals, equalsAll, getExtension, getExtensions, getUuid, hasExtensions, hashCode, isMarked, removeExtension, removeExtension, setMarked, toString |
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneDataElement |
---|
isSealed, seal |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
static final java.lang.String PERSISTENCE_CLASS_IDENTIFIER
IStatefulObject
persistence class identifier, value: "clone"
Method Detail |
---|
java.util.Date getCreationDate()
java.lang.String getCreator()
java.lang.String getFileUuid()
int getOffset()
void setOffset(int offset)
offset
- the character offset to the beginning of the file at which the clone begins,
inclusive, first char is 0.getOffset()
int getLength()
void setLength(int length)
length
- the length in characters, never <=0.getLength()
java.lang.String getGroupUuid()
void setGroupUuid(java.lang.String groupUuid)
groupUuid
- the clone group for this clone, if any, may be NULLgetGroupUuid()
java.lang.String getOriginUuid()
void setOriginUuid(java.lang.String originUuid)
originUuid
- uuid of the origin clone, may be NULL.java.util.Collection<java.lang.String> getClassifications()
NOTE: The returned collection may not be modified in any way. It may or may not be backed by the internal classification data structure. A client who wants to iterate over the set while the clone might be concurrently modified, should create its own shallow copy.
Refer to the CLASSIFICATION_* constants in IClassificationProvider
for more information.
IClassificationProvider
boolean hasClassification(java.lang.String classification)
Refer to the CLASSIFICATION_* constants of the IClassificationProvider
for more information.
classification
- the classification to check for, never null.
IClassificationProvider
void addClassification(java.lang.String classification)
Refer to the CLASSIFICATION_* constants of the IClassificationProvider
for more information.
classification
- the classification string to add, never null.IClassificationProvider
void removeClassification(java.lang.String classification)
Refer to the CLASSIFICATION_* constants of the IClassificationProvider
for more information.
classification
- the classification string to remove, never null.IClassificationProvider
java.lang.String getOriginalContent()
java.lang.String getContent()
java.util.Date getModificationDate()
getCreationDate()
.
IClone.State getCloneState()
IClone.State
of this clone instance.
java.util.Date getCloneStateChangeDate()
IClone.State
.
getCreationDate()
.
setCloneState(State, double, String)
java.util.Date getCloneStateDismissalDate()
double getCloneStateWeight()
IClone.State.NOTIFY
and IClone.State.WARN
.
Otherwise the value is 0.
IClone.State.NOTIFY
nor IClone.State.WARN
.IEvaluationResult.getWeight()
java.lang.String getCloneStateMessage()
IClone.State.NOTIFY
and IClone.State.WARN
. However, the value is
optional and can be NULL at any time.
This value is displayed to the user and should therefore be human readable and localised.
IClone.State.NOTIFY
nor IClone.State.WARN
.void setCloneState(IClone.State cloneState, double weight, java.lang.String message)
IClone.State
of this clone instance.
getCloneStateChangeDate()
.
cloneState
- new state for this clone, never null.weight
- weight of the new state. This value only has a meaning for
states IClone.State.NOTIFY
and IClone.State.WARN
and should be 0 for all others.message
- optional human readable reason behind the new clone state. This value should only
be defined for states IClone.State.NOTIFY
and IClone.State.WARN
(even then it may be NULL)
and should be NULL for all other states.getCloneState()
,
getCloneStateChangeDate()
,
getCloneStateWeight()
,
getCloneStateMessage()
boolean isTransient()
IClone
instances may be created for temporary use, i.e. to keep track of the source
for CutCopyPaste actions. Such transient IClone
instances must be tracked like
normal instances (their position can change due to modifications to the file), however they
are not yet part of any clone group and are therefore not real clones. Such transient instances
must not be persisted.
void setTransient(boolean _transient)
_transient
- true if this clone should not yet be persisted, false otherwise.isTransient()
int getEndOffset()
setOffset(int)
and setLength(int)
to modify this value.
boolean intersects(IClone clone)
clone
- the other clone to compare against, never null.
boolean intersects(int offset, int length)
offset
- start offset, 0-based character count, always >= 0.length
- length in characters, always >= 0.
A length of 0 is handled like a length of 1 (endOffset=offset).
Which means a 0-length range may intersect with another range.
int compareTo(IClone o)
However, we're ordering by start line, start offset, end offset here.
Two clones which are not equal may well start at the same line/offset.
If this happens some extra code tries to resolve the issue by putting one
of the clones first and the other one second.
compareTo
in interface java.lang.Comparable<IClone>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |