001 /* 002 * Copyright (c) 2009 The openGion Project. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 013 * either express or implied. See the License for the specific language 014 * governing permissions and limitations under the License. 015 */ 016 package org.opengion.hayabusa.resource; 017 018 import java.util.Comparator; 019 import java.io.Serializable; 020 021 /** 022 * ç”»é¢æƒ??ã®å–å¾—ã?為ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ェースã§ã™ã? 023 * 024 * ãƒã‚°ã‚¤ãƒ³æ™‚ã?パスワードã?ãƒã‚§ãƒ?‚¯ã‚?国åã?è˜åˆ¥ID?Œã?ータルペã?ジã®URLãªã© 025 * 個人æƒ??を管ç?•ã›ã¾ã™ã? 026 * 特ã«,ç”»é¢ã‚¢ã‚¯ã‚»ã‚¹æ™‚ã?権é™ã‚„メールã®é€ä¿¡?Œå„ç”»é¢ã«ç”»é¢æƒ??を表示ã—ãŸã‚? 027 * エラー時ã?ãƒã‚°ãƒ•ァイル?Œãƒ†ãƒ³ãƒãƒ©ãƒªãƒ?‚£ãƒ¬ã‚¯ãƒˆãƒªãªã©ã‚‚管ç?—ã¾ã™ã? 028 * 029 * @og.group リソース管ç? 030 * 031 * @version 4.0 032 * @author Kazuhiko Hasegawa 033 * @since JDK5.0, 034 */ 035 public class GUIInfoComparator implements Comparator<GUIInfo>,Serializable { // 4.3.3.6 (2008/11/15) Genericsè¦å‘Šå¯¾å¿? 036 private static final long serialVersionUID = 433620081115L ; 037 038 /** 039 * é ?ºä»˜ã‘ã®ãŸã‚ã« 2 ã¤ã®å¼•数を比è¼?—ã¾ã™ã? 040 * 041 * æœ??ã®å¼•æ•°ã?2 番目ã®å¼•数よりå°ã•ã??åˆã?è²??æ•´æ•°ã€? 042 * 両方ãŒç‰ã—ã??åˆã? 0ã€æœ€åˆã?引数ã?2 番目ã®å¼•数より大ãã„å ´åˆã? 043 * æ£ã®æ•´æ•°ã‚’è¿”ã—ã¾ã™ã? 044 * 045 * @og.rev 4.3.3.6 (2008/11/15) Genericsè¦å‘Šå¯¾å¿? 046 * 047 * @param o1 比è¼?¯¾è±¡ã®æœ??ã®ã‚ªãƒ–ジェクãƒ? 048 * @param o2 比è¼?¯¾è±¡ã® 2 番目ã®ã‚ªãƒ–ジェクãƒ? 049 * 050 * @return æœ??ã®å¼•æ•°ã?2 番目ã®å¼•数よりå°ã•ã??åˆã?è²??æ•´æ•°ã€ä¸¡æ–¹ãŒç‰ã—ã??åˆã? 0ã€æœ€åˆã?引数ã?2 番目ã®å¼•数より大ãã„å ´åˆã?æ£ã®æ•´æ•° 051 */ 052 public int compare( final GUIInfo o1, final GUIInfo o2 ) { 053 String key1 = o1.getKey(); 054 String key2 = o2.getKey(); 055 return key1.compareTo( key2 ); 056 } 057 // public int compare( final Object o1, final Object o2 ) { 058 // if( o1 instanceof GUIInfo && 059 // o2 instanceof GUIInfo ) { 060 // String key1 = ((GUIInfo)o1).getKey(); 061 // String key2 = ((GUIInfo)o2).getKey(); 062 // return key1.compareTo( key2 ); 063 // } 064 // throw new ClassCastException(); 065 // } 066 067 }