|
||||||||||
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 VisualAttribute
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
A merge policy that always returns the first value. |
static class |
AttributeMergePolicy.MergePolicyAlwaysSecond
A merge policy that always returns the second value. |
static class |
AttributeMergePolicy.MergePolicyLogicalAnd
A merge policy that always returns the logical conjunction (AND) of given values. |
static class |
AttributeMergePolicy.MergePolicyLogicalOr
A merge policy that always returns the logical alternative (OR) of given values. |
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(Object firstValue,
Object secondValue)
Verifies if two values are of type Boolean . |
boolean |
equals(Object obj)
|
abstract String |
getId()
Returns the unique id of this policy. |
int |
hashCode()
|
abstract Object |
mergeValues(Attribute attribute,
Object firstValue,
Object secondValue)
Merges two Attribute values into one. |
static AttributeMergePolicy |
resolve(String id)
Returns policy based on its id. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, 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(Object firstValue, Object secondValue)
Boolean
. Helper method.
first
- second
-
true
if types of both values are of type Boolean
public abstract String getId()
public abstract Object mergeValues(Attribute attribute, Object firstValue, 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 mergefirstValue
- first valuesecondValue
- second value
AttributeValue
that is the result of merging given values according to the policypublic static final AttributeMergePolicy resolve(String id)
id
- policy id
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |