public static void main(String[] args) { EnumMap<AlarmPoints, Command> em = new EnumMap<AlarmPoints, Command>(AlarmPoints.class); em.put( KITCHEN, new Command() { public void action() { print("Kitchen fire!"); } }); em.put( BATHROOM, new Command() { public void action() { print("Bathroom alert!"); } }); for (Map.Entry<AlarmPoints, Command> e : em.entrySet()) { printnb(e.getKey() + ": "); e.getValue().action(); } try { // If there's no value for a particular key: em.get(UTILITY).action(); } catch (Exception e) { print(e); } }
public static boolean isValid(EnumMap<?, ?> expected, EnumMap<?, ?> map) { if (map == null) { return false; } Set<?> entries = expected.entrySet(); Iterator<?> entryIter = entries.iterator(); while (entryIter.hasNext()) { Entry<?, ?> entry = (Entry<?, ?>) entryIter.next(); Object value = map.get(entry.getKey()); if (value != entry.getValue()) { if (value == null || entry.getValue() == null) { return false; } if (!map.get(entry.getKey()).equals(entry.getValue())) { return false; } } } return true; }
/** When the result receiver is closed, the results are written to disk. */ @Override public void close() throws IOException { for (Map.Entry<ResultType, Integer> entry : resultCounts.entrySet()) { ResultType type = entry.getKey(); Integer count = entry.getValue(); write(type.getEnding(), type.getName(), count); } }
private static <K extends Enum<K>, V> ImmutableMap<K, V> copyOfEnumMap( Map<K, ? extends V> original) { EnumMap<K, V> copy = new EnumMap<K, V>(original); for (Map.Entry<?, ?> entry : copy.entrySet()) { checkEntryNotNull(entry.getKey(), entry.getValue()); } return ImmutableEnumMap.asImmutable(copy); }
/** * _update ghosts. * * @param moves the moves */ private void _updateGhosts(EnumMap<GHOST, MOVE> moves) { for (Entry<GHOST, MOVE> entry : moves.entrySet()) { Ghost ghost = fantasmas.get(entry.getKey()); if (ghost.lairTime == 0) { if (ghost.edibleTime == 0 || ghost.edibleTime % GHOST_SPEED_REDUCTION != 0) { ghost.lastMoveMade = _checkGhostDir(ghost, entry.getValue()); moves.put(entry.getKey(), ghost.lastMoveMade); ghost.currentNodeIndex = laberintoActua.graph[ghost.currentNodeIndex].neighbourhood.get(ghost.lastMoveMade); } } } }
/* (non-Javadoc) * doesn't have to be synchronized if we assume infinite change, only if we'll * be decrementing the amount * * @see emh.orbitz.vend.utility.ChangeMaker#makeChange(java.math.BigDecimal) */ @Override public EnumMap<UsDenomination, Integer> makeChange(BigDecimal amount) { EnumMap<UsDenomination, Integer> result = new EnumMap<UsDenomination, Integer>(UsDenomination.class); for (Map.Entry<UsDenomination, Integer> e : currencyAvailable.entrySet()) { // if the amount is greater than or equal to the denomination amount while (amount.compareTo(e.getKey().getValue()) > -1 && (e.getValue() == null || e.getValue() > 0)) { amount = amount.subtract(e.getKey().getValue()); result.put(e.getKey(), nullSafeAdd(result.get(e.getKey()), 1)); // experimental, a non-infinite coin source // if (e.getValue() != null) { // e.setValue(e.getValue() - 1); // } } } return result; }
private boolean _reverseGhosts(EnumMap<GHOST, MOVE> moves, boolean force) { boolean reversed = false; boolean globalReverse = false; if (Math.random() < GHOST_REVERSAL) globalReverse = true; for (Entry<GHOST, MOVE> entry : moves.entrySet()) { Ghost ghost = fantasmas.get(entry.getKey()); if (tiempoLvlActual > 1 && ghost.lairTime == 0 && ghost.lastMoveMade != MOVE.NEUTRAL) { if (force || (pildoraPoderFueComida || globalReverse)) { ghost.lastMoveMade = ghost.lastMoveMade.opposite(); ghost.currentNodeIndex = laberintoActua.graph[ghost.currentNodeIndex].neighbourhood.get(ghost.lastMoveMade); reversed = true; timeOfLastGlobalReversal = tiempoTotal; } } } return reversed; }
/** * Matches a string against this named pattern. * * @param string the string to match * @return a match object, or null if there was no match */ public NamedPatternMatch<E> match(String string) { Matcher matcher = pattern.matcher(string); while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); if (start == 0 && end == string.length()) { Map<E, String> resultMap = new EnumMap<E, String>(groupEnum); Set<Entry<E, Integer>> entries = groupIndexes.entrySet(); for (Entry<E, Integer> entry : entries) { E group = entry.getKey(); Integer groupIndex = entry.getValue(); String result = matcher.group(groupIndex); resultMap.put(group, result); } return new NamedPatternMatch<E>(resultMap); } } return null; }
private ID3v22Frames() { // The defined v22 frames supportedFrames.add(FRAME_ID_V2_ACCOMPANIMENT); supportedFrames.add(FRAME_ID_V2_ALBUM); supportedFrames.add(FRAME_ID_V2_ARTIST); supportedFrames.add(FRAME_ID_V2_ATTACHED_PICTURE); supportedFrames.add(FRAME_ID_V2_AUDIO_ENCRYPTION); supportedFrames.add(FRAME_ID_V2_BPM); supportedFrames.add(FRAME_ID_V2_COMMENT); supportedFrames.add(FRAME_ID_V2_COMPOSER); supportedFrames.add(FRAME_ID_V2_ENCRYPTED_FRAME); supportedFrames.add(FRAME_ID_V2_CONDUCTOR); supportedFrames.add(FRAME_ID_V2_CONTENT_GROUP_DESC); supportedFrames.add(FRAME_ID_V2_COPYRIGHTINFO); supportedFrames.add(FRAME_ID_V2_ENCODEDBY); supportedFrames.add(FRAME_ID_V2_EQUALISATION); supportedFrames.add(FRAME_ID_V2_EVENT_TIMING_CODES); supportedFrames.add(FRAME_ID_V2_FILE_TYPE); supportedFrames.add(FRAME_ID_V2_GENERAL_ENCAPS_OBJECT); supportedFrames.add(FRAME_ID_V2_GENRE); supportedFrames.add(FRAME_ID_V2_HW_SW_SETTINGS); supportedFrames.add(FRAME_ID_V2_INITIAL_KEY); supportedFrames.add(FRAME_ID_V2_IPLS); supportedFrames.add(FRAME_ID_V2_ISRC); supportedFrames.add(FRAME_ID_V2_LANGUAGE); supportedFrames.add(FRAME_ID_V2_LENGTH); supportedFrames.add(FRAME_ID_V2_LINKED_INFO); supportedFrames.add(FRAME_ID_V2_LYRICIST); supportedFrames.add(FRAME_ID_V2_MEDIA_TYPE); supportedFrames.add(FRAME_ID_V2_MPEG_LOCATION_LOOKUP_TABLE); supportedFrames.add(FRAME_ID_V2_MUSIC_CD_ID); supportedFrames.add(FRAME_ID_V2_ORIGARTIST); supportedFrames.add(FRAME_ID_V2_ORIG_FILENAME); supportedFrames.add(FRAME_ID_V2_ORIG_LYRICIST); supportedFrames.add(FRAME_ID_V2_ORIG_TITLE); supportedFrames.add(FRAME_ID_V2_PLAYLIST_DELAY); supportedFrames.add(FRAME_ID_V2_PLAY_COUNTER); supportedFrames.add(FRAME_ID_V2_POPULARIMETER); supportedFrames.add(FRAME_ID_V2_PUBLISHER); supportedFrames.add(FRAME_ID_V2_RECOMMENDED_BUFFER_SIZE); supportedFrames.add(FRAME_ID_V2_RELATIVE_VOLUME_ADJUSTMENT); supportedFrames.add(FRAME_ID_V2_REMIXED); supportedFrames.add(FRAME_ID_V2_REVERB); supportedFrames.add(FRAME_ID_V2_SET); supportedFrames.add(FRAME_ID_V2_SYNC_LYRIC); supportedFrames.add(FRAME_ID_V2_SYNC_TEMPO); supportedFrames.add(FRAME_ID_V2_TDAT); supportedFrames.add(FRAME_ID_V2_TIME); supportedFrames.add(FRAME_ID_V2_TITLE); supportedFrames.add(FRAME_ID_V2_TITLE_REFINEMENT); supportedFrames.add(FRAME_ID_V2_TORY); supportedFrames.add(FRAME_ID_V2_TRACK); supportedFrames.add(FRAME_ID_V2_TRDA); supportedFrames.add(FRAME_ID_V2_TSIZ); supportedFrames.add(FRAME_ID_V2_TYER); supportedFrames.add(FRAME_ID_V2_UNIQUE_FILE_ID); supportedFrames.add(FRAME_ID_V2_UNSYNC_LYRICS); supportedFrames.add(FRAME_ID_V2_URL_ARTIST_WEB); supportedFrames.add(FRAME_ID_V2_URL_COMMERCIAL); supportedFrames.add(FRAME_ID_V2_URL_COPYRIGHT); supportedFrames.add(FRAME_ID_V2_URL_FILE_WEB); supportedFrames.add(FRAME_ID_V2_URL_OFFICIAL_RADIO); supportedFrames.add(FRAME_ID_V2_URL_PAYMENT); supportedFrames.add(FRAME_ID_V2_URL_PUBLISHERS); supportedFrames.add(FRAME_ID_V2_URL_SOURCE_WEB); supportedFrames.add(FRAME_ID_V2_USER_DEFINED_INFO); supportedFrames.add(FRAME_ID_V2_USER_DEFINED_URL); // Extension extensionFrames.add(FRAME_ID_V2_IS_COMPILATION); extensionFrames.add(FRAME_ID_V2_TITLE_SORT_ORDER_ITUNES); extensionFrames.add(FRAME_ID_V2_ARTIST_SORT_ORDER_ITUNES); extensionFrames.add(FRAME_ID_V2_ALBUM_SORT_ORDER_ITUNES); extensionFrames.add(FRAME_ID_V2_ALBUM_ARTIST_SORT_ORDER_ITUNES); extensionFrames.add(FRAME_ID_V2_COMPOSER_SORT_ORDER_ITUNES); // Common commonFrames.add(FRAME_ID_V2_ARTIST); commonFrames.add(FRAME_ID_V2_ALBUM); commonFrames.add(FRAME_ID_V2_TITLE); commonFrames.add(FRAME_ID_V2_GENRE); commonFrames.add(FRAME_ID_V2_TRACK); commonFrames.add(FRAME_ID_V2_TYER); commonFrames.add(FRAME_ID_V2_COMMENT); // Binary binaryFrames.add(FRAME_ID_V2_ATTACHED_PICTURE); binaryFrames.add(FRAME_ID_V2_AUDIO_ENCRYPTION); binaryFrames.add(FRAME_ID_V2_ENCRYPTED_FRAME); binaryFrames.add(FRAME_ID_V2_EQUALISATION); binaryFrames.add(FRAME_ID_V2_EVENT_TIMING_CODES); binaryFrames.add(FRAME_ID_V2_GENERAL_ENCAPS_OBJECT); binaryFrames.add(FRAME_ID_V2_RELATIVE_VOLUME_ADJUSTMENT); binaryFrames.add(FRAME_ID_V2_RECOMMENDED_BUFFER_SIZE); binaryFrames.add(FRAME_ID_V2_UNIQUE_FILE_ID); // Map frameid to a name idToValue.put(FRAME_ID_V2_ACCOMPANIMENT, "Text: Band/Orchestra/Accompaniment"); idToValue.put(FRAME_ID_V2_ALBUM, "Text: Album/Movie/Show title"); idToValue.put( FRAME_ID_V2_ARTIST, "Text: Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group"); idToValue.put(FRAME_ID_V2_ATTACHED_PICTURE, "Attached picture"); idToValue.put(FRAME_ID_V2_AUDIO_ENCRYPTION, "Audio encryption"); idToValue.put(FRAME_ID_V2_BPM, "Text: BPM (Beats Per Minute)"); idToValue.put(FRAME_ID_V2_COMMENT, "Comments"); idToValue.put(FRAME_ID_V2_COMPOSER, "Text: Composer"); idToValue.put(FRAME_ID_V2_CONDUCTOR, "Text: Conductor/Performer refinement"); idToValue.put(FRAME_ID_V2_CONTENT_GROUP_DESC, "Text: Content group description"); idToValue.put(FRAME_ID_V2_COPYRIGHTINFO, "Text: Copyright message"); idToValue.put(FRAME_ID_V2_ENCODEDBY, "Text: Encoded by"); idToValue.put(FRAME_ID_V2_ENCRYPTED_FRAME, "Encrypted meta frame"); idToValue.put(FRAME_ID_V2_EQUALISATION, "Equalization"); idToValue.put(FRAME_ID_V2_EVENT_TIMING_CODES, "Event timing codes"); idToValue.put(FRAME_ID_V2_FILE_TYPE, "Text: File type"); idToValue.put(FRAME_ID_V2_GENERAL_ENCAPS_OBJECT, "General encapsulated datatype"); idToValue.put(FRAME_ID_V2_GENRE, "Text: Content type"); idToValue.put( FRAME_ID_V2_HW_SW_SETTINGS, "Text: Software/hardware and settings used for encoding"); idToValue.put(FRAME_ID_V2_INITIAL_KEY, "Text: Initial key"); idToValue.put(FRAME_ID_V2_IPLS, "Involved people list"); idToValue.put(FRAME_ID_V2_ISRC, "Text: ISRC (International Standard Recording Code)"); idToValue.put(FRAME_ID_V2_LANGUAGE, "Text: Language(s)"); idToValue.put(FRAME_ID_V2_LENGTH, "Text: Length"); idToValue.put(FRAME_ID_V2_LINKED_INFO, "Linked information"); idToValue.put(FRAME_ID_V2_LYRICIST, "Text: Lyricist/text writer"); idToValue.put(FRAME_ID_V2_MEDIA_TYPE, "Text: Media type"); idToValue.put(FRAME_ID_V2_MPEG_LOCATION_LOOKUP_TABLE, "MPEG location lookup table"); idToValue.put(FRAME_ID_V2_MUSIC_CD_ID, "Music CD Identifier"); idToValue.put(FRAME_ID_V2_ORIGARTIST, "Text: Original artist(s)/performer(s)"); idToValue.put(FRAME_ID_V2_ORIG_FILENAME, "Text: Original filename"); idToValue.put(FRAME_ID_V2_ORIG_LYRICIST, "Text: Original Lyricist(s)/text writer(s)"); idToValue.put(FRAME_ID_V2_ORIG_TITLE, "Text: Original album/Movie/Show title"); idToValue.put(FRAME_ID_V2_PLAYLIST_DELAY, "Text: Playlist delay"); idToValue.put(FRAME_ID_V2_PLAY_COUNTER, "Play counter"); idToValue.put(FRAME_ID_V2_POPULARIMETER, "Popularimeter"); idToValue.put(FRAME_ID_V2_PUBLISHER, "Text: Publisher"); idToValue.put(FRAME_ID_V2_RECOMMENDED_BUFFER_SIZE, "Recommended buffer size"); idToValue.put(FRAME_ID_V2_RELATIVE_VOLUME_ADJUSTMENT, "Relative volume adjustment"); idToValue.put(FRAME_ID_V2_REMIXED, "Text: Interpreted, remixed, or otherwise modified by"); idToValue.put(FRAME_ID_V2_REVERB, "Reverb"); idToValue.put(FRAME_ID_V2_SET, "Text: Part of a setField"); idToValue.put(FRAME_ID_V2_SET_SUBTITLE, "Text: Set subtitle"); idToValue.put(FRAME_ID_V2_SYNC_LYRIC, "Synchronized lyric/text"); idToValue.put(FRAME_ID_V2_SYNC_TEMPO, "Synced tempo codes"); idToValue.put(FRAME_ID_V2_TDAT, "Text: Date"); idToValue.put(FRAME_ID_V2_TIME, "Text: Time"); idToValue.put(FRAME_ID_V2_TITLE, "Text: Title/Songname/Content description"); idToValue.put(FRAME_ID_V2_TITLE_REFINEMENT, "Text: Subtitle/Description refinement"); idToValue.put(FRAME_ID_V2_TORY, "Text: Original release year"); idToValue.put(FRAME_ID_V2_TRACK, "Text: Track number/Position in setField"); idToValue.put(FRAME_ID_V2_TRDA, "Text: Recording dates"); idToValue.put(FRAME_ID_V2_TSIZ, "Text: Size"); idToValue.put(FRAME_ID_V2_TYER, "Text: Year"); idToValue.put(FRAME_ID_V2_UNIQUE_FILE_ID, "Unique file identifier"); idToValue.put(FRAME_ID_V2_UNSYNC_LYRICS, "Unsychronized lyric/text transcription"); idToValue.put(FRAME_ID_V2_URL_ARTIST_WEB, "URL: Official artist/performer webpage"); idToValue.put(FRAME_ID_V2_URL_COMMERCIAL, "URL: Commercial information"); idToValue.put(FRAME_ID_V2_URL_COPYRIGHT, "URL: Copyright/Legal information"); idToValue.put(FRAME_ID_V2_URL_FILE_WEB, "URL: Official audio file webpage"); idToValue.put(FRAME_ID_V2_URL_OFFICIAL_RADIO, "URL: Official radio station"); idToValue.put(FRAME_ID_V2_URL_PAYMENT, "URL: Official payment site"); idToValue.put(FRAME_ID_V2_URL_PUBLISHERS, "URL: Publishers official webpage"); idToValue.put(FRAME_ID_V2_URL_SOURCE_WEB, "URL: Official audio source webpage"); idToValue.put(FRAME_ID_V2_USER_DEFINED_INFO, "User defined text information frame"); idToValue.put(FRAME_ID_V2_USER_DEFINED_URL, "User defined URL link frame"); idToValue.put(FRAME_ID_V2_IS_COMPILATION, "Is Compilation"); idToValue.put(FRAME_ID_V2_TITLE_SORT_ORDER_ITUNES, "Text: title sort order"); idToValue.put(FRAME_ID_V2_ARTIST_SORT_ORDER_ITUNES, "Text: artist sort order"); idToValue.put(FRAME_ID_V2_ALBUM_SORT_ORDER_ITUNES, "Text: album sort order"); idToValue.put(FRAME_ID_V2_ALBUM_ARTIST_SORT_ORDER_ITUNES, "Text:Album Artist Sort Order Frame"); idToValue.put(FRAME_ID_V2_COMPOSER_SORT_ORDER_ITUNES, "Text:Composer Sort Order Frame"); createMaps(); multipleFrames.add(FRAME_ID_V2_ATTACHED_PICTURE); multipleFrames.add(FRAME_ID_V2_UNIQUE_FILE_ID); multipleFrames.add(FRAME_ID_V2_POPULARIMETER); multipleFrames.add(FRAME_ID_V2_USER_DEFINED_INFO); multipleFrames.add(FRAME_ID_V2_USER_DEFINED_URL); multipleFrames.add(FRAME_ID_V2_COMMENT); multipleFrames.add(FRAME_ID_V2_UNSYNC_LYRICS); multipleFrames.add(FRAME_ID_V2_GENERAL_ENCAPS_OBJECT); multipleFrames.add(FRAME_ID_V2_URL_ARTIST_WEB); // Mapping generic key to id3v22 key tagFieldToId3.put(FieldKey.ALBUM, ID3v22FieldKey.ALBUM); tagFieldToId3.put(FieldKey.ALBUM_ARTIST, ID3v22FieldKey.ALBUM_ARTIST); tagFieldToId3.put(FieldKey.ALBUM_ARTIST_SORT, ID3v22FieldKey.ALBUM_ARTIST_SORT); tagFieldToId3.put(FieldKey.ALBUM_SORT, ID3v22FieldKey.ALBUM_SORT); tagFieldToId3.put(FieldKey.AMAZON_ID, ID3v22FieldKey.AMAZON_ID); tagFieldToId3.put(FieldKey.ARTIST, ID3v22FieldKey.ARTIST); tagFieldToId3.put(FieldKey.ARTIST_SORT, ID3v22FieldKey.ARTIST_SORT); tagFieldToId3.put(FieldKey.BARCODE, ID3v22FieldKey.BARCODE); tagFieldToId3.put(FieldKey.BPM, ID3v22FieldKey.BPM); tagFieldToId3.put(FieldKey.CATALOG_NO, ID3v22FieldKey.CATALOG_NO); tagFieldToId3.put(FieldKey.COMMENT, ID3v22FieldKey.COMMENT); tagFieldToId3.put(FieldKey.COMPOSER, ID3v22FieldKey.COMPOSER); tagFieldToId3.put(FieldKey.COMPOSER_SORT, ID3v22FieldKey.COMPOSER_SORT); tagFieldToId3.put(FieldKey.CONDUCTOR, ID3v22FieldKey.CONDUCTOR); tagFieldToId3.put(FieldKey.COVER_ART, ID3v22FieldKey.COVER_ART); tagFieldToId3.put(FieldKey.CUSTOM1, ID3v22FieldKey.CUSTOM1); tagFieldToId3.put(FieldKey.CUSTOM2, ID3v22FieldKey.CUSTOM2); tagFieldToId3.put(FieldKey.CUSTOM3, ID3v22FieldKey.CUSTOM3); tagFieldToId3.put(FieldKey.CUSTOM4, ID3v22FieldKey.CUSTOM4); tagFieldToId3.put(FieldKey.CUSTOM5, ID3v22FieldKey.CUSTOM5); tagFieldToId3.put(FieldKey.DISC_NO, ID3v22FieldKey.DISC_NO); tagFieldToId3.put(FieldKey.DISC_SUBTITLE, ID3v22FieldKey.DISC_SUBTITLE); tagFieldToId3.put(FieldKey.DISC_TOTAL, ID3v22FieldKey.DISC_NO); tagFieldToId3.put(FieldKey.ENCODER, ID3v22FieldKey.ENCODER); tagFieldToId3.put(FieldKey.FBPM, ID3v22FieldKey.FBPM); tagFieldToId3.put(FieldKey.GENRE, ID3v22FieldKey.GENRE); tagFieldToId3.put(FieldKey.GROUPING, ID3v22FieldKey.GROUPING); tagFieldToId3.put(FieldKey.ISRC, ID3v22FieldKey.ISRC); tagFieldToId3.put(FieldKey.IS_COMPILATION, ID3v22FieldKey.IS_COMPILATION); tagFieldToId3.put(FieldKey.KEY, ID3v22FieldKey.KEY); tagFieldToId3.put(FieldKey.LANGUAGE, ID3v22FieldKey.LANGUAGE); tagFieldToId3.put(FieldKey.LYRICIST, ID3v22FieldKey.LYRICIST); tagFieldToId3.put(FieldKey.LYRICS, ID3v22FieldKey.LYRICS); tagFieldToId3.put(FieldKey.MEDIA, ID3v22FieldKey.MEDIA); tagFieldToId3.put(FieldKey.MOOD, ID3v22FieldKey.MOOD); tagFieldToId3.put(FieldKey.MUSICBRAINZ_ARTISTID, ID3v22FieldKey.MUSICBRAINZ_ARTISTID); tagFieldToId3.put(FieldKey.MUSICBRAINZ_DISC_ID, ID3v22FieldKey.MUSICBRAINZ_DISC_ID); tagFieldToId3.put( FieldKey.MUSICBRAINZ_ORIGINAL_RELEASE_ID, ID3v22FieldKey.MUSICBRAINZ_ORIGINAL_RELEASEID); tagFieldToId3.put( FieldKey.MUSICBRAINZ_RELEASEARTISTID, ID3v22FieldKey.MUSICBRAINZ_RELEASEARTISTID); tagFieldToId3.put(FieldKey.MUSICBRAINZ_RELEASEID, ID3v22FieldKey.MUSICBRAINZ_RELEASEID); tagFieldToId3.put( FieldKey.MUSICBRAINZ_RELEASE_COUNTRY, ID3v22FieldKey.MUSICBRAINZ_RELEASE_COUNTRY); tagFieldToId3.put( FieldKey.MUSICBRAINZ_RELEASE_GROUP_ID, ID3v22FieldKey.MUSICBRAINZ_RELEASE_GROUP_ID); tagFieldToId3.put( FieldKey.MUSICBRAINZ_RELEASE_TRACK_ID, ID3v22FieldKey.MUSICBRAINZ_RELEASE_TRACK_ID); tagFieldToId3.put( FieldKey.MUSICBRAINZ_RELEASE_STATUS, ID3v22FieldKey.MUSICBRAINZ_RELEASE_STATUS); tagFieldToId3.put(FieldKey.MUSICBRAINZ_RELEASE_TYPE, ID3v22FieldKey.MUSICBRAINZ_RELEASE_TYPE); tagFieldToId3.put(FieldKey.MUSICBRAINZ_TRACK_ID, ID3v22FieldKey.MUSICBRAINZ_TRACK_ID); tagFieldToId3.put(FieldKey.MUSICBRAINZ_WORK_ID, ID3v22FieldKey.MUSICBRAINZ_WORK_ID); tagFieldToId3.put(FieldKey.MUSICIP_ID, ID3v22FieldKey.MUSICIP_ID); tagFieldToId3.put(FieldKey.OCCASION, ID3v22FieldKey.OCCASION); tagFieldToId3.put(FieldKey.ORIGINAL_ALBUM, ID3v22FieldKey.ORIGINAL_ALBUM); tagFieldToId3.put(FieldKey.ORIGINAL_ARTIST, ID3v22FieldKey.ORIGINAL_ARTIST); tagFieldToId3.put(FieldKey.ORIGINAL_LYRICIST, ID3v22FieldKey.ORIGINAL_LYRICIST); tagFieldToId3.put(FieldKey.ORIGINAL_YEAR, ID3v22FieldKey.ORIGINAL_YEAR); tagFieldToId3.put(FieldKey.QUALITY, ID3v22FieldKey.QUALITY); tagFieldToId3.put(FieldKey.RATING, ID3v22FieldKey.RATING); tagFieldToId3.put(FieldKey.RECORD_LABEL, ID3v22FieldKey.RECORD_LABEL); tagFieldToId3.put(FieldKey.REMIXER, ID3v22FieldKey.REMIXER); tagFieldToId3.put(FieldKey.SCRIPT, ID3v22FieldKey.SCRIPT); tagFieldToId3.put(FieldKey.SUBTITLE, ID3v22FieldKey.SUBTITLE); tagFieldToId3.put(FieldKey.TAGS, ID3v22FieldKey.TAGS); tagFieldToId3.put(FieldKey.TEMPO, ID3v22FieldKey.TEMPO); tagFieldToId3.put(FieldKey.TITLE, ID3v22FieldKey.TITLE); tagFieldToId3.put(FieldKey.TITLE_SORT, ID3v22FieldKey.TITLE_SORT); tagFieldToId3.put(FieldKey.TRACK, ID3v22FieldKey.TRACK); tagFieldToId3.put(FieldKey.TRACK_TOTAL, ID3v22FieldKey.TRACK_TOTAL); tagFieldToId3.put(FieldKey.URL_DISCOGS_ARTIST_SITE, ID3v22FieldKey.URL_DISCOGS_ARTIST_SITE); tagFieldToId3.put(FieldKey.URL_DISCOGS_RELEASE_SITE, ID3v22FieldKey.URL_DISCOGS_RELEASE_SITE); tagFieldToId3.put(FieldKey.URL_LYRICS_SITE, ID3v22FieldKey.URL_LYRICS_SITE); tagFieldToId3.put(FieldKey.URL_OFFICIAL_ARTIST_SITE, ID3v22FieldKey.URL_OFFICIAL_ARTIST_SITE); tagFieldToId3.put(FieldKey.URL_OFFICIAL_RELEASE_SITE, ID3v22FieldKey.URL_OFFICIAL_RELEASE_SITE); tagFieldToId3.put(FieldKey.URL_WIKIPEDIA_ARTIST_SITE, ID3v22FieldKey.URL_WIKIPEDIA_ARTIST_SITE); tagFieldToId3.put( FieldKey.URL_WIKIPEDIA_RELEASE_SITE, ID3v22FieldKey.URL_WIKIPEDIA_RELEASE_SITE); tagFieldToId3.put(FieldKey.YEAR, ID3v22FieldKey.YEAR); tagFieldToId3.put(FieldKey.ENGINEER, ID3v22FieldKey.ENGINEER); tagFieldToId3.put(FieldKey.PRODUCER, ID3v22FieldKey.PRODUCER); tagFieldToId3.put(FieldKey.MIXER, ID3v22FieldKey.MIXER); tagFieldToId3.put(FieldKey.DJMIXER, ID3v22FieldKey.DJMIXER); tagFieldToId3.put(FieldKey.ARRANGER, ID3v22FieldKey.ARRANGER); tagFieldToId3.put(FieldKey.ARTISTS, ID3v22FieldKey.ARTISTS); tagFieldToId3.put(FieldKey.ACOUSTID_FINGERPRINT, ID3v22FieldKey.ACOUSTID_FINGERPRINT); tagFieldToId3.put(FieldKey.ACOUSTID_ID, ID3v22FieldKey.ACOUSTID_ID); tagFieldToId3.put(FieldKey.COUNTRY, ID3v22FieldKey.COUNTRY); for (Map.Entry<FieldKey, ID3v22FieldKey> next : tagFieldToId3.entrySet()) { id3ToTagField.put(next.getValue(), next.getKey()); } }
Divider(EnumMap<Direction, Sublayer> sublayers) { for (EnumMap.Entry<Direction, Sublayer> sublayer : sublayers.entrySet()) { this.sublayers.put(sublayer.getKey(), sublayer.getValue()); } }