pl.edu.agh.cast.model.attributes
Class AttributeMergePolicy.MergePolicyAlwaysSecond

java.lang.Object
  extended by pl.edu.agh.cast.model.attributes.AttributeMergePolicy
      extended by pl.edu.agh.cast.model.attributes.AttributeMergePolicy.MergePolicyAlwaysSecond
All Implemented Interfaces:
Serializable
Enclosing class:
AttributeMergePolicy

public static final class AttributeMergePolicy.MergePolicyAlwaysSecond
extends AttributeMergePolicy

A merge policy that always returns the second value.

Author:
AGH CAST Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class pl.edu.agh.cast.model.attributes.AttributeMergePolicy
AttributeMergePolicy.MergePolicyAlwaysFirst, AttributeMergePolicy.MergePolicyAlwaysSecond, AttributeMergePolicy.MergePolicyLogicalAnd, AttributeMergePolicy.MergePolicyLogicalOr
 
Field Summary
 
Fields inherited from class pl.edu.agh.cast.model.attributes.AttributeMergePolicy
MERGE_POLICY_ALWAYS_FIRST, MERGE_POLICY_ALWAYS_SECOND, MERGE_POLICY_LOGICAL_AND, MERGE_POLICY_LOGICAL_OR
 
Method Summary
 String getId()
          Returns the unique id of this policy.
 Object mergeValues(Attribute attribute, Object firstValue, Object secondValue)
          Merges two Attribute values into one.
 
Methods inherited from class pl.edu.agh.cast.model.attributes.AttributeMergePolicy
checkIfBoolean, equals, hashCode, resolve, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

mergeValues

public Object mergeValues(Attribute attribute,
                          Object firstValue,
                          Object secondValue)
Merges two Attribute values into one. It is possible that the returned value will be one of the parameters, or a completely new object.

Specified by:
mergeValues in class AttributeMergePolicy
Parameters:
attribute - Attribute to merge
firstValue - first value
secondValue - second value
Returns:
an AttributeValue that is the result of merging given values according to the policy
See Also:
#mergeValues(pl.edu.agh.cast.model.attributes.VisualAttribute, java.lang.Object, java.lang.Object)

getId

public String getId()
Returns the unique id of this policy.

Specified by:
getId in class AttributeMergePolicy
Returns:
policy id
See Also:
AttributeMergePolicy.getId()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.