/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/importcontacts/ContactsCache.java

  • Committer: Tim Marston
  • Date: 2013-06-22 17:29:31 UTC
  • Revision ID: tim@ed.am-20130622172931-ujydoni23t3a543b
minor style tweaks

Show diffs side-by-side

added added

removed removed

1
1
/*
2
2
 * ContactsCache.java
3
3
 *
4
 
 * Copyright (C) 2011 to 2013 Tim Marston <tim@ed.am>
 
4
 * Copyright (C) 2011 to 2012 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Import Contacts program (hereafter referred
7
7
 * to as "this program").  For more information, see
137
137
                = new HashMap< Long, HashSet< String > >();
138
138
        private HashMap< Long, HashSet< String > > _contactNotes
139
139
                = new HashMap< Long, HashSet< String > >();
140
 
        private HashMap< Long, String > _contactBirthdays
141
 
                = new HashMap< Long, String >();
142
140
 
143
141
        public boolean canLookup( CacheIdentifier identifier )
144
142
        {
339
337
                set.add( note );
340
338
        }
341
339
 
342
 
        public boolean hasAssociatedBirthday( Long id, String birthday )
343
 
        {
344
 
                birthday = normaliseBirthday( birthday );
345
 
                if( birthday == null ) return false;
346
 
 
347
 
                String found = _contactBirthdays.get( id );
348
 
                return found != null && found.equalsIgnoreCase( birthday );
349
 
        }
350
 
 
351
 
        public void addAssociatedBirthday( Long id, String birthday )
352
 
        {
353
 
                birthday = normaliseBirthday( birthday );
354
 
                if( birthday == null ) return;
355
 
 
356
 
                _contactBirthdays.put( id, birthday );
357
 
        }
358
 
 
359
340
        static public String normaliseName( String name )
360
341
        {
361
342
                if( name == null ) return null;
397
378
                note = note.trim();
398
379
                return note.length() > 0? note : null;
399
380
        }
400
 
 
401
 
        static public String normaliseBirthday( String birthday )
402
 
        {
403
 
                if( birthday == null ) return null;
404
 
                birthday = birthday.trim();
405
 
                return birthday.length() > 0? birthday : null;
406
 
        }
407
381
}