OSDN Git Service
(root)
/
mikutoga
/
TogaGem.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
メソッド名修正
[mikutoga/TogaGem.git]
/
src
/
main
/
java
/
jp
/
sourceforge
/
mikutoga
/
corelib
/
I18nText.java
diff --git
a/src/main/java/jp/sourceforge/mikutoga/corelib/I18nText.java
b/src/main/java/jp/sourceforge/mikutoga/corelib/I18nText.java
index
001fa45
..
f9857f2
100644
(file)
--- a/
src/main/java/jp/sourceforge/mikutoga/corelib/I18nText.java
+++ b/
src/main/java/jp/sourceforge/mikutoga/corelib/I18nText.java
@@
-37,8
+37,8
@@
public class I18nText implements CharSequence {
public static final String CODE639_GLOBAL = LOCALE_GLOBAL.getLanguage();
static{
public static final String CODE639_GLOBAL = LOCALE_GLOBAL.getLanguage();
static{
- assert
CODE639_PRIMARY.equals("ja"
);
- assert
CODE639_GLOBAL .equals("en"
);
+ assert
"ja".equals(CODE639_PRIMARY
);
+ assert
"en".equals(CODE639_GLOBAL
);
}
private final Map<String, String> nameMap = new HashMap<String, String>();
}
private final Map<String, String> nameMap = new HashMap<String, String>();
@@
-56,7
+56,7
@@
public class I18nText implements CharSequence {
* @param seq プライマリ文字列。nullの場合は削除動作
*/
public void setPrimaryText(CharSequence seq){
* @param seq プライマリ文字列。nullの場合は削除動作
*/
public void setPrimaryText(CharSequence seq){
- setText(CODE639_PRIMARY, seq);
+ set
I18n
Text(CODE639_PRIMARY, seq);
return;
}
return;
}
@@
-65,7
+65,7
@@
public class I18nText implements CharSequence {
* @param seq グローバル文字列。nullの場合は削除動作
*/
public void setGlobalText(CharSequence seq){
* @param seq グローバル文字列。nullの場合は削除動作
*/
public void setGlobalText(CharSequence seq){
- setText(CODE639_GLOBAL, seq);
+ set
I18n
Text(CODE639_GLOBAL, seq);
return;
}
return;
}
@@
-75,10
+75,10
@@
public class I18nText implements CharSequence {
* @param seq 文字列。nullの場合は削除動作
* @throws NullPointerException ロケール引数がnull
*/
* @param seq 文字列。nullの場合は削除動作
* @throws NullPointerException ロケール引数がnull
*/
- public void setText(Locale locale, CharSequence seq)
+ public void set
I18n
Text(Locale locale, CharSequence seq)
throws NullPointerException{
String code639 = locale.getLanguage();
throws NullPointerException{
String code639 = locale.getLanguage();
- setText(code639, seq);
+ set
I18n
Text(code639, seq);
return;
}
return;
}
@@
-88,7
+88,7
@@
public class I18nText implements CharSequence {
* @param seq 文字列。nullの場合は削除動作
* @throws NullPointerException 言語コードがnull
*/
* @param seq 文字列。nullの場合は削除動作
* @throws NullPointerException 言語コードがnull
*/
- public void setText(String code639, CharSequence seq)
+ public void set
I18n
Text(String code639, CharSequence seq)
throws NullPointerException{
if(code639 == null) throw new NullPointerException();
throws NullPointerException{
if(code639 == null) throw new NullPointerException();
@@
-103,44
+103,44
@@
public class I18nText implements CharSequence {
}
/**
}
/**
- * 言語コードに応じた文字列を返す。
- * @param code639 ISO639言語コード
+ * プライマリ文字列を返す。
* @return 文字列。見つからなければnullを返す。
* @return 文字列。見つからなければnullを返す。
- * @throws NullPointerException 引数がnull
*/
*/
- public String getText(String code639) throws NullPointerException{
- if(code639 == null) throw new NullPointerException();
- String result = this.nameMap.get(code639);
+ public String getPrimaryText(){
+ String result = getI18nText(CODE639_PRIMARY);
return result;
}
/**
return result;
}
/**
- * ロケールに応じた文字列を返す。
- * @param locale ロケール
+ * グローバル文字列を返す。
* @return 文字列。見つからなければnullを返す。
* @return 文字列。見つからなければnullを返す。
- * @throws NullPointerException 引数がnull
*/
*/
- public String getText(Locale locale) throws NullPointerException{
- String code639 = locale.getLanguage();
- String result = getText(code639);
+ public String getGlobalText(){
+ String result = getI18nText(CODE639_GLOBAL);
return result;
}
/**
return result;
}
/**
- * プライマリ文字列を返す。
+ * ロケールに応じた文字列を返す。
+ * @param locale ロケール
* @return 文字列。見つからなければnullを返す。
* @return 文字列。見つからなければnullを返す。
+ * @throws NullPointerException 引数がnull
*/
*/
- public String getPrimaryText(){
- String result = getText(CODE639_PRIMARY);
+ public String getI18nText(Locale locale) throws NullPointerException{
+ String code639 = locale.getLanguage();
+ String result = getI18nText(code639);
return result;
}
/**
return result;
}
/**
- * グローバル文字列を返す。
+ * 言語コードに応じた文字列を返す。
+ * @param code639 ISO639言語コード
* @return 文字列。見つからなければnullを返す。
* @return 文字列。見つからなければnullを返す。
+ * @throws NullPointerException 引数がnull
*/
*/
- public String getGlobalText(){
- String result = getText(CODE639_GLOBAL);
+ public String getI18nText(String code639) throws NullPointerException{
+ if(code639 == null) throw new NullPointerException();
+ String result = this.nameMap.get(code639);
return result;
}
return result;
}
@@
-170,7
+170,7
@@
public class I18nText implements CharSequence {
* 実行環境のデフォルトロケールに応じた文字列を返す。
* 見つからなければグローバル文字列、プライマリ文字列の順に返す。
* それでも見つからなければ適当な言語コードの文字列を返す。
* 実行環境のデフォルトロケールに応じた文字列を返す。
* 見つからなければグローバル文字列、プライマリ文字列の順に返す。
* それでも見つからなければ適当な言語コードの文字列を返す。
- * それでも見つからなければ空文字列を返す。
+ * それでも見つからなければ
長さ0の
空文字列を返す。
* デフォルトロケールの確認はその都度行われる。
* @return 文字列
*/
* デフォルトロケールの確認はその都度行われる。
* @return 文字列
*/
@@
-210,7
+210,7
@@
public class I18nText implements CharSequence {
/**
* 全言語の文字列を削除する。
*/
/**
* 全言語の文字列を削除する。
*/
- public void
removeAll
Text(){
+ public void
clearI18n
Text(){
this.nameMap.clear();
return;
}
this.nameMap.clear();
return;
}