org.openstreetmap.josm.data.osm
Class Changeset

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.Changeset
All Implemented Interfaces:
Tagged

public final class Changeset
extends java.lang.Object
implements Tagged

Represents a single changeset in JOSM. For now its only used during upload but in the future we may do more.


Field Summary
private  java.util.Date closedAt
          the date this changeset was closed at
private  ChangesetDataSet content
          the changeset content
private  java.util.Date createdAt
          date this changeset was created at
private  int id
          the changeset id
private  boolean incomplete
          indicates whether this changeset is incomplete.
private  LatLon max
          the max.
static int MAX_COMMENT_LENGTH
          The maximum changeset comment text length allowed by API 0.6
private  LatLon min
          the min.
private  boolean open
          indicates whether this changeset is still open or not
private  java.util.Map<java.lang.String,java.lang.String> tags
          the map of tags
private  User user
          the user who owns the changeset
 
Constructor Summary
Changeset()
          Creates a new changeset with id 0.
Changeset(Changeset other)
          Creates a clone of other
Changeset(int id)
          Creates a changeset with id id.
 
Method Summary
 int compareTo(Changeset other)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String get(java.lang.String key)
          Replies the value of the given key; null, if there is no value for this key
 Bounds getBounds()
           
 java.util.Date getClosedAt()
           
 ChangesetDataSet getContent()
           
 java.util.Date getCreatedAt()
           
 java.lang.String getDisplayName(NameFormatter formatter)
           
 int getId()
           
 java.util.Map<java.lang.String,java.lang.String> getKeys()
          Replies the map of key/value pairs.
 LatLon getMax()
           
 LatLon getMin()
           
 java.lang.String getName()
           
 User getUser()
           
 boolean hasContent()
           
 boolean hasEqualSemanticAttributes(Changeset other)
           
 int hashCode()
           
 boolean hasKeys()
          Replies true, if there is at least one key/value pair; false, otherwise
 boolean isIncomplete()
           
 boolean isNew()
           
 boolean isOpen()
           
 java.util.Collection<java.lang.String> keySet()
          Replies the set of keys
 void mergeFrom(Changeset other)
           
 void put(java.lang.String key, java.lang.String value)
          Sets a key/value pairs
 void remove(java.lang.String key)
          Removes a given key/value pair
 void removeAll()
          Removes all tags
 void setClosedAt(java.util.Date closedAt)
           
 void setContent(ChangesetDataSet content)
           
 void setCreatedAt(java.util.Date createdAt)
           
 void setId(int id)
           
 void setIncomplete(boolean incomplete)
           
 void setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
          Sets the map of key/value pairs
 void setMax(LatLon max)
           
 void setMin(LatLon min)
           
 void setOpen(boolean open)
           
 void setUser(User user)
           
 void visit(Visitor v)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_COMMENT_LENGTH

public static final int MAX_COMMENT_LENGTH
The maximum changeset comment text length allowed by API 0.6

See Also:
Constant Field Values

id

private int id
the changeset id


user

private User user
the user who owns the changeset


createdAt

private java.util.Date createdAt
date this changeset was created at


closedAt

private java.util.Date closedAt
the date this changeset was closed at


open

private boolean open
indicates whether this changeset is still open or not


min

private LatLon min
the min. coordinates of the bounding box of this changeset


max

private LatLon max
the max. coordinates of the bounding box of this changeset


tags

private java.util.Map<java.lang.String,java.lang.String> tags
the map of tags


incomplete

private boolean incomplete
indicates whether this changeset is incomplete. For an incomplete changeset we only know its id


content

private ChangesetDataSet content
the changeset content

Constructor Detail

Changeset

public Changeset()
Creates a new changeset with id 0.


Changeset

public Changeset(int id)
Creates a changeset with id id. If id > 0, sets incomplete to true.

Parameters:
id - the id

Changeset

public Changeset(Changeset other)
Creates a clone of other

Parameters:
other - the other changeset. If null, creates a new changeset with id 0.
Method Detail

visit

public void visit(Visitor v)

compareTo

public int compareTo(Changeset other)

getName

public java.lang.String getName()

getDisplayName

public java.lang.String getDisplayName(NameFormatter formatter)

getId

public int getId()

setId

public void setId(int id)

getUser

public User getUser()

setUser

public void setUser(User user)

getCreatedAt

public java.util.Date getCreatedAt()

setCreatedAt

public void setCreatedAt(java.util.Date createdAt)

getClosedAt

public java.util.Date getClosedAt()

setClosedAt

public void setClosedAt(java.util.Date closedAt)

isOpen

public boolean isOpen()

setOpen

public void setOpen(boolean open)

getMin

public LatLon getMin()

setMin

public void setMin(LatLon min)

getMax

public LatLon getMax()

getBounds

public Bounds getBounds()

setMax

public void setMax(LatLon max)

getKeys

public java.util.Map<java.lang.String,java.lang.String> getKeys()
Description copied from interface: Tagged
Replies the map of key/value pairs. Never null, but may be the empty map.

Specified by:
getKeys in interface Tagged
Returns:
the map of key/value pairs

setKeys

public void setKeys(java.util.Map<java.lang.String,java.lang.String> keys)
Description copied from interface: Tagged
Sets the map of key/value pairs

Specified by:
setKeys in interface Tagged
Parameters:
keys - the map of key value pairs. If null, reset to the empty map.

isIncomplete

public boolean isIncomplete()

setIncomplete

public void setIncomplete(boolean incomplete)

put

public void put(java.lang.String key,
                java.lang.String value)
Description copied from interface: Tagged
Sets a key/value pairs

Specified by:
put in interface Tagged
Parameters:
key - the key
value - the value. If null, removes the key/value pair.

get

public java.lang.String get(java.lang.String key)
Description copied from interface: Tagged
Replies the value of the given key; null, if there is no value for this key

Specified by:
get in interface Tagged
Parameters:
key - the key
Returns:
the value

remove

public void remove(java.lang.String key)
Description copied from interface: Tagged
Removes a given key/value pair

Specified by:
remove in interface Tagged
Parameters:
key - the key

removeAll

public void removeAll()
Description copied from interface: Tagged
Removes all tags

Specified by:
removeAll in interface Tagged

hasEqualSemanticAttributes

public boolean hasEqualSemanticAttributes(Changeset other)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hasKeys

public boolean hasKeys()
Description copied from interface: Tagged
Replies true, if there is at least one key/value pair; false, otherwise

Specified by:
hasKeys in interface Tagged
Returns:
true, if there is at least one key/value pair; false, otherwise

keySet

public java.util.Collection<java.lang.String> keySet()
Description copied from interface: Tagged
Replies the set of keys

Specified by:
keySet in interface Tagged
Returns:
the set of keys

isNew

public boolean isNew()

mergeFrom

public void mergeFrom(Changeset other)

hasContent

public boolean hasContent()

getContent

public ChangesetDataSet getContent()

setContent

public void setContent(ChangesetDataSet content)


JOSM