Verified Owner
Top Description Constructors Methods
org.jabref.model.undo

pack-priv final Class ChangeIdentity

extends Object
Class Inheritance
Imports
java.util.List

Identity comparison helpers for change records.

org.jabref.model.entry.BibEntry, org.jabref.model.entry.BibtexString and org.jabref.model.database.BibDatabase all compare by content, but a change targets one particular object: two entries with identical fields are distinct rows the user can edit independently. Records holding them therefore compare and hash by identity, so a change against one row is never considered equal to the same change against its twin.

Identity also keeps the hash stable. Content-based hashing over a mutable object -- a database's hash covers its entry list -- would change under a record that is already in the undo stack.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
hash(Object value)

pack-priv static int
hashAll(List<?> values)

pack-priv static boolean
same(Object left, Object right)

pack-priv static boolean
sameAll(List<?> left, List<?> right)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ChangeIdentityback to summary
private ChangeIdentity()

Method Detail

hashback to summary
pack-priv static int hash(Object value)
hashAllback to summary
pack-priv static int hashAll(List<?> values)
sameback to summary
pack-priv static boolean same(Object left, Object right)
sameAllback to summary
pack-priv static boolean sameAll(List<?> left, List<?> right)