|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.edu.agh.cast.model.attributes.AttributeMergePolicy
public abstract class AttributeMergePolicy
This class represents a policy of merging two values of an Attribute into
one. It defines a few basic policies, however custom ones may be defined by
extending this class.
| Nested Class Summary | |
|---|---|
static class |
AttributeMergePolicy.MergePolicyAlwaysFirst
|
static class |
AttributeMergePolicy.MergePolicyAlwaysSecond
|
static class |
AttributeMergePolicy.MergePolicyLogicalAnd
|
static class |
AttributeMergePolicy.MergePolicyLogicalOr
|
| Field Summary | |
|---|---|
static AttributeMergePolicy |
MERGE_POLICY_ALWAYS_FIRST
A merge policy that always returns the first value. |
static AttributeMergePolicy |
MERGE_POLICY_ALWAYS_SECOND
A merge policy that always returns the second value. |
static AttributeMergePolicy |
MERGE_POLICY_LOGICAL_AND
A merge policy that always returns the logical conjunction (AND) of given values. |
static AttributeMergePolicy |
MERGE_POLICY_LOGICAL_OR
A merge policy that always returns the logical alternative (OR) of given values. |
| Constructor Summary | |
|---|---|
protected |
AttributeMergePolicy()
|
| Method Summary | |
|---|---|
protected boolean |
checkIfBoolean(java.lang.Object firstValue,
java.lang.Object secondValue)
Verifies if two values are of type Boolean. |
boolean |
equals(java.lang.Object obj)
|
abstract java.lang.String |
getId()
|
abstract java.lang.Object |
mergeValues(Attribute attribute,
java.lang.Object firstValue,
java.lang.Object secondValue)
Merges two Attribute values into one. |
static AttributeMergePolicy |
resolve(java.lang.String id)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final AttributeMergePolicy MERGE_POLICY_ALWAYS_FIRST
public static final AttributeMergePolicy MERGE_POLICY_ALWAYS_SECOND
public static final AttributeMergePolicy MERGE_POLICY_LOGICAL_AND
Boolean
public static final AttributeMergePolicy MERGE_POLICY_LOGICAL_OR
Boolean
| Constructor Detail |
|---|
protected AttributeMergePolicy()
| Method Detail |
|---|
protected boolean checkIfBoolean(java.lang.Object firstValue,
java.lang.Object secondValue)
Boolean. Helper method.
first - second -
true if types of both values are of type Booleanpublic abstract java.lang.String getId()
public abstract java.lang.Object mergeValues(Attribute attribute,
java.lang.Object firstValue,
java.lang.Object secondValue)
Attribute values into one. It is possible that the
returned value will be one of the parameters, or a completely new
object.
attribute - Attribute to mergefirst - first valuesecond - second value
AttributeValue that is the result of merging given
values according to the policypublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static final AttributeMergePolicy resolve(java.lang.String id)
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 | |||||||||