Add some comparisons methods, fix the existing checks
[jvcard.git] / src / be / nikiroo / jvcard / Card.java
index e714b5633a9b5047d4a08df36463bbda05bab2f4..986f81d17c0932cba2081d7586b0ce115ad25547 100644 (file)
@@ -58,8 +58,7 @@ public class Card extends BaseClass<Contact> {
                        this.file = file;
                        switch (format) {
                        case VCard21:
-                               this.name = file.getName().replaceAll(
-                                               ".[vV][cC][fF]$", "");
+                               this.name = file.getName().replaceAll(".[vV][cC][fF]$", "");
                                break;
                        case Abook:
                        default:
@@ -177,11 +176,11 @@ public class Card extends BaseClass<Contact> {
        }
 
        /**
-        * Return the input which was used to open this {@link Card}.
+        * Return the {@link File} which was used to open this {@link Card}.
         * 
         * @return the input
         */
-       public File getInput() {
+       public File getFile() {
                return file;
        }
 
@@ -219,6 +218,16 @@ public class Card extends BaseClass<Contact> {
                return toString(Format.VCard21);
        }
 
+       @Override
+       public String getId() {
+               return "" + name;
+       }
+
+       @Override
+       public String getState() {
+               return "" + name + format;
+       }
+
        /**
         * Load the data from the given {@link File} under the given {@link Format}.
         *