|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.conflict.tags.MultiValueResolutionDecision
public class MultiValueResolutionDecision
Represents a decision for a conflict due to multiple possible value for a tag.
Field Summary | |
---|---|
private TagCollection |
tags
the collection of tags for which a decision is needed |
private MultiValueDecisionType |
type
the type of decision |
private java.lang.String |
value
the selected value if type is MultiValueDecisionType.KEEP_ONE |
Constructor Summary | |
---|---|
MultiValueResolutionDecision()
constuctor |
|
MultiValueResolutionDecision(TagCollection tags)
Creates a new decision for the tag collection tags . |
Method Summary | |
---|---|
void |
applyTo(java.util.Collection<? extends OsmPrimitive> primitives)
Applies this resolution to a collection of primitives |
void |
applyTo(OsmPrimitive primitive)
Applies the resolution to an OsmPrimitive |
protected void |
autoDecide()
Tries to find the best decision based on the current values. |
Command |
buildChangeCommand(java.util.Collection<? extends OsmPrimitive> primitives)
Builds a change command for applying this resolution to a collection of primitives |
Command |
buildChangeCommand(OsmPrimitive primitive)
Builds a change command for applying this resolution to a primitive |
boolean |
canKeepAll()
Replies true, if this resolution has more than 1 possible non-empty values |
boolean |
canKeepNone()
Replies true if the empty value is a possible value in this resolution |
java.lang.String |
getChosenValue()
Replies the chosen value |
MultiValueDecisionType |
getDecisionType()
Replies the type of the resolution |
java.lang.String |
getKey()
Replies the key of the tag to be resolved by this resolution |
Tag |
getResolution()
Replies a tag representing the current resolution. |
java.util.List<java.lang.String> |
getValues()
Replies the list of possible, non empty values |
boolean |
isDecided()
Replies true if this resolution is decided |
void |
keepAll()
Apply the decision to keep all values |
void |
keepNone()
Apply the decision to keep no value |
void |
keepOne(java.lang.String value)
Apply the decision to keep exactly one value |
void |
setNew(java.lang.String value)
sets a new value for this |
void |
undecide()
marks this as undecided |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private MultiValueDecisionType type
private TagCollection tags
private java.lang.String value
type
is MultiValueDecisionType.KEEP_ONE
Constructor Detail |
---|
public MultiValueResolutionDecision()
public MultiValueResolutionDecision(TagCollection tags) throws java.lang.IllegalArgumentException
tags
.
All tags must have the same key.
tags
- the tags. Must not be null.
java.lang.IllegalArgumentException
- thrown if tags is null
java.lang.IllegalArgumentException
- thrown if there are more than one keys
java.lang.IllegalArgumentException
- thrown if tags is emptyMethod Detail |
---|
protected void autoDecide()
public void keepNone()
public void keepAll()
public void keepOne(java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
value
- the value to keep
java.lang.IllegalArgumentException
- thrown if value is null
java.lang.IllegalStateException
- thrown if value is not in the list of known values for this tagpublic void setNew(java.lang.String value)
value
- the new vlauepublic void undecide()
public java.lang.String getChosenValue() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown if this resolution is not yet decidedpublic java.util.List<java.lang.String> getValues()
public java.lang.String getKey()
public boolean canKeepNone()
public boolean canKeepAll()
public boolean isDecided()
public MultiValueDecisionType getDecisionType()
public void applyTo(OsmPrimitive primitive) throws java.lang.IllegalStateException
OsmPrimitive
primitive
- the primitive
java.lang.IllegalStateException
- thrown if this resolution is not resolved yetpublic void applyTo(java.util.Collection<? extends OsmPrimitive> primitives) throws java.lang.IllegalStateException
primitives
- the collection of primitives
java.lang.IllegalStateException
- thrown if this resolution is not resolved yetpublic Command buildChangeCommand(OsmPrimitive primitive) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
primitive
- the primitive
java.lang.IllegalArgumentException
- thrown if primitive is null
java.lang.IllegalStateException
- thrown if this resolution is not resolved yetpublic Command buildChangeCommand(java.util.Collection<? extends OsmPrimitive> primitives)
primitives
- the collection of primitives
java.lang.IllegalArgumentException
- thrown if primitives is null
java.lang.IllegalStateException
- thrown if this resolution is not resolved yetpublic Tag getResolution()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |