public class Entry
extends java.lang.Object
Entry
represent an element in the index table (either the
compress table or the expanded one, it contains some useful information about
the element it represents in the index table, like if that element was
contained by the base resource or not, was it contained by a contributor or
not, it also gives the ability to check if the element exits in the merged
resource at any specific moment, all objects have a weight of 1 in the
expanded index table, in the compressed index table an Entry could have a
weight greater than 1, it will be increased by 1 for each subsequent element
we remove from beneth it unless there is non trivial entry between them, an
entry is considered trivial when the base and all contributors bits on it are
true.
the bits byte contains bits the represents the Entry attributes
6 5 4 3 2 1 0
X X X X X X X
c o n t r i b u t o r s b i t s merged bit base bit
the bits byte used to save on memory consumption, the only side effect for it
is that we have only 5 bits avliable for contributor bits, so this Entry
class supports up to a maximum of 5 contributors if you need to change it to
support more than 5 contributors change the bit type to int instead of byte,
or use boolean bitsConstructor and Description |
---|
Entry()
constructor for the Entry
|
Modifier and Type | Method and Description |
---|---|
boolean |
existsInBase()
Returns whether or not the object for this entry exists in the base.
|
boolean |
existsInContributor(org.eclipse.emf.ecore.resource.Resource contributor)
Returns whether or not the object for this entry exists in the
contributor.
|
boolean |
existsInMerged()
Returns whether or not the object for this entry exists in the merged.
|
Delta |
getDelta() |
int |
getWeight()
this function will return the weight of the entry
|
boolean |
represents(Delta aDelta) |
void |
setDelta(Delta delta) |
int |
setWeight(int i)
this function will set the weight of the entry
|
java.lang.String |
toString() |
public Delta getDelta()
public void setDelta(Delta delta)
delta
- The delta to set.public boolean existsInBase()
public boolean existsInMerged()
public boolean existsInContributor(org.eclipse.emf.ecore.resource.Resource contributor)
contributor
- public int setWeight(int i)
i
- the new weight of the entrypublic int getWeight()
public boolean represents(Delta aDelta)
public java.lang.String toString()
toString
in class java.lang.Object