diff --git a/AgileWorks/.gitignore b/AgileWorks/.gitignore deleted file mode 100644 index 90a00a4c8e6503668a63d163809f0e8830682af7..0000000000000000000000000000000000000000 --- a/AgileWorks/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/.classpath -/.project -/.settings -/WebContent/script/livehtml-deveropment-properties.js -/WebContent/script/livehtml-properties-dev.js -/service/job-manager/log/ -/service/job-manager/spool/data/ -/service/job-manager/spool/job/ -/service/job-manager/spool/schedule/* -!/service/job-manager/spool/schedule/$INIT.xml -/target diff --git a/AgileWorks/WebContent/META-INF/MANIFEST.MF b/AgileWorks/WebContent/META-INF/MANIFEST.MF deleted file mode 100644 index 58630c02ef423cffd6dd6aafd946eb8512040c37..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/AgileWorks/WebContent/TSlib/TSCal.css b/AgileWorks/WebContent/TSlib/TSCal.css deleted file mode 100644 index 1532e3f2d446fb48e019c532345be276ff18b6bd..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/TSCal.css +++ /dev/null @@ -1,59 +0,0 @@ -@charset "UTF-8"; -/* Copyright (C) 2010 ATLED CORP. All rights Reserved. - */ -body {background-color: #ffffff;} - - -.tb {height:20px; text-align:center; vertical-align:middle; background-color: #999999;} /* operation line */ -.ly {height:20px; text-align:center; vertical-align:middle; background-color: #ddddff;} /* week caption line */ -.lc {height:20px; text-align:right; vertical-align:middle;} /* date line */ -.bt {width:18px; height:18px; cursor: pointer;} /* button image */ -.ss1 {font-family: "MS Gothic"; font-size: 11pt; color: #000000} - - -.tc { -/* -color: #ffffff; border: solid 1px #999999; -*/ -} /* tool area common */ - -.cc {height:20px; font: 13px "MS PGothic", "Hiragino Kaku Gothic Pro W3", "Osaka", sans-serif;} /* calendar area common */ -.wd0 {color: #000000;} /* week line (mon - fri) */ -.sn0 {color: #ff1010;} /* week line (sun) */ -.st0 {color: #1010ff;} /* week line (sat) */ -.wd1 {color: #000000; cursor: pointer;} /* this month (mon - fri) */ -.sn1 {color: #ff0000; cursor: pointer;} /* this month (sun) */ -.st1 {color: #0000ff; cursor: pointer;} /* this month (sat) */ -.wd2 {color: #999999; cursor: default;} /* prev/next month (mon - fri) */ -.sn2 {color: #ff9999; cursor: default;} /* prev/next month (sun) */ -.st2 {color: #9999ff; cursor: default;} /* prev/next month (sat) */ -.tdy {font-weight:bold;} /* today (system date) */ -.sl1 {border:solid 2px #caf9d8;} /* selected */ -.sl2 {border:solid 2px #ffffff;} /* unselected */ - -a.ta { - display: block; - color: #ffffff; - text-decoration: none; -} -a.ta:hover, a.ta:active { -/* background-color: #9999ff; - border: solid 1px #ffffff;*/ -} -span.ta { - display: block; - color: #ffffff; - text-decoration: none; -} - -.ta1 { - font: bold 15px Verdana, "MS PGothic", "Hiragino Kaku Gothic Pro W3", "Osaka", sans-serif; -} -.ta2 { - font: 13px "MS PGothic", "Hiragino Kaku Gothic Pro W3", "Osaka", sans-serif; padding: 3px 0px 0px 0px; -} - -.tad { - color: #666666; - cursor: default; -} diff --git a/AgileWorks/WebContent/TSlib/TSCal.jsp b/AgileWorks/WebContent/TSlib/TSCal.jsp deleted file mode 100644 index fef6f73abe042fb5646a27f6a70602f2135e0a09..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/TSCal.jsp +++ /dev/null @@ -1,10 +0,0 @@ -<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> - - - -Calendar - - - -
- diff --git a/AgileWorks/WebContent/TSlib/TSCalFunc.js b/AgileWorks/WebContent/TSlib/TSCalFunc.js deleted file mode 100644 index 6f5f8b1ea331526dbcfccb5e2ead7162c573aee0..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/TSCalFunc.js +++ /dev/null @@ -1,565 +0,0 @@ -// Copyright (C) 2007 ATLED CORP. All rights Reserved. - -var IMGDIR = "./images/"; -var IMG_ALE = IMGDIR + "button_l.gif"; // 前月(enabled) -var IMG_ALD = IMGDIR + "button_l.gif"; // 前月(disabled) -var IMG_ARE = IMGDIR + "button_r.gif"; // 次月(enabled) -var IMG_ARD = IMGDIR + "button_r.gif"; // 次月(disabled) - -var COL_MVC = "#caf9d8"; // MouseOver色 -var COL_MTC = "#ffffff"; // MouseOut色 -var COL_MVT = "#9999ff"; // ツール行MouseOver背景色 -var COL_MVB = "#ffffff"; // ツール行MouseOver枠線色 -var COL_MTT = "#999999"; // ツール行MouseOut背景色 -var COL_MTB = "#999999"; // ツール行MouseOut枠線色 - -var aYStr = new Array( - I18N.t("js.control.Calendar.day.Sunday"), // 日 - I18N.t("js.control.Calendar.day.Monday"), // 月 - I18N.t("js.control.Calendar.day.Tuesday"), // 火 - I18N.t("js.control.Calendar.day.Wednesday"), // 水 - I18N.t("js.control.Calendar.day.Thursday"), // 木 - I18N.t("js.control.Calendar.day.Friday"), // 金 - I18N.t("js.control.Calendar.day.Saturday") // 土 -); -var aYStl = new Array("sn", "wd", "wd", "wd", "wd", "wd", "st"); - -var aHDay = new Array(); - -var dtToday = null; // 今日の日付(システム日付) -var dtTarget; -var targetY; -var targetM; -var targetD; -var dtFirst; -var firstYear; -var firstMonth; -var firstDate; - -var dtStart; -var dtEnd; -var dtFmt; - -var ttStart = null; -var ttEnd = null; - -var msgTd; - -var pId; - -function setTarget() { - targetY = dtTarget.getFullYear(); - targetM = dtTarget.getMonth(); - targetD = dtTarget.getDate(); -} - -// 選択日付返却 -function sendDate(d) { - if (!window.opener.closed) { - window.opener.putDate(d, dtFmt); - } -} - -function clearDate(){ - if (!window.opener.closed) { - window.opener.clearDate(); - } - window.close(); - return false; -}; - -function closeWindow(){ - window.close(); - return false; -}; - -// DblClick -function mDc() { - sendDate(dtTarget); - window.close(); -} - -// MouseDown -function mDn(d) { - dtOld = new Date(targetY, targetM, targetD); - dtTarget = new Date(firstYear, firstMonth, firstDate + d); - setTarget(dtTarget); - document.getElementById(pId).style.borderColor = COL_MTC; - pId = "d" + d; - document.getElementById(pId).style.borderColor = COL_MVC; -} - - -// MouseOver -function mOv(o) { - o.style.backgroundColor = COL_MVC; -} - -// MouseOut -function mOt(o) { - o.style.backgroundColor = COL_MTC; -} - -// MouseOver ToolBar -function mOvTB(o) { - o.style.backgroundColor = COL_MVT; - o.style.borderColor = COL_MVB; -} - -// MouseOut ToolBar -function mOtTB(o) { - o.style.backgroundColor = COL_MTT; - o.style.borderColor = COL_MTB; -} - -function mKp(d) { - var curM = targetM; - var k = event.keyCode; - var df = 0; - switch(k) { - case 13: - mDc(); return; - case 32: - mDn(d); return; - case 37: // L - df = -1; break; - case 38: // U - df = -7; break; - case 39: // R - df = 1; break; - case 40: // D - df = 7; break; - default: - return; - } - dtTarget = new Date(firstYear, firstMonth, firstDate + d + df); - setTarget(dtTarget); - if (curM != targetM) { - dispCal(); - } else { - document.getElementById(pId).style.borderColor = COL_MTC; - pId = "d" + (d + df); - var nd = document.getElementById(pId); - if (nd != null) { - nd.style.borderColor = COL_MVC; - nd.focus(); - } - } -} - - -// 入力値取得 -function getTargetDate() { - w = XWEB.Date.getLocalDate(); - dtToday = new Date(w.getFullYear(), w.getMonth(), w.getDate()); - - if(window.opener.getDefaultDate()){ - str=window.opener.getDefaultDate(); -// if (str.length < 10 ) { - if (str.length < 10 && str.match(/^2\D{3}/)==false ) { - str = "20" + str; - } - }else{ - str=formatDateYMD(w); - } - dtTarget = new Date(Date.parse(str)); - if (isNaN(dtTarget) == true) { - dtTarget = dtToday; - } - setTarget(); -} - -// 該当月開始日付取得 -function calcfirstDate() { - d = new Date(targetY, targetM, 1); - dtFirst = new Date(targetY, targetM, 1 - d.getDay()); - firstYear = dtFirst.getFullYear(); - firstMonth = dtFirst.getMonth(); - firstDate = dtFirst.getDate(); -} - -// 指定日分進める -function dateAdd(d, days) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate() + days); -} - -// 指定日分戻す -function dateSub(d, days) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate() - days); -} - - -// 日付文字列生成(YYYY/MM/DD) -function formatDateYMD(dt) { - var y = dt.getFullYear(); - var m = dt.getMonth() + 1; - var d = dt.getDate(); - return (y + "/" + ((m < 10) ? "0" : "") + m + "/" + ((d < 10) ? "0" : "") + d); -} - -// 日付文字列生成(YYYY/MM/DD) -function formatDateYM(dt) { - var y = dt.getFullYear(); - var m = dt.getMonth() + 1; - return (y + "/" + ((m < 10) ? "0" : "") + m); -} - -// 月移動 -function moveMonth(k) { - if (k == 0) { - dtTarget = dtToday; - } else { - dtTarget = new Date(targetY, targetM + k, targetD); - if (dtTarget.getDate() != targetD) { - dtTarget = dateSub(dtTarget, dtTarget.getDate()); - } - } - setTarget(); - dispCal(); - -// sendDate(dtTarget); -} - -function getNYobi(y, m, n, yo) { - wDate = new Date(y, (m - 1), 1); // y/m/1の - yobi = wDate.getDay(); // 曜日を取得 -> yobi - dm = (7 - (yobi - yo)) % 7 + 1; // 第1 wd曜日 - d = dm + ((n - 1) * 7); // 対象日(第n wd曜) - return d; -} - - -function getHolidayStr(y, m, d) { - switch (m) { - case 1: - if (d == 1) { return "元旦"; } - if (y < 2000) { - if (d == 15) { return "成人の日"; } - } else { - if (d == getNYobi(y, 1, 2, 1)) { return "成人の日"; } // 1月第2月曜日 - } - break; - - case 2: - if (d == 11) { return "建国記念日"; } - break; - - case 3: - var nS3 = Math.floor(20.8431 + 0.242194 * (y - 1980) - Math.floor((y - 1980) / 4)); // (1980-2099まで) - if (d == nS3) { return "春分の日"; } - break; - - case 4: - if (d == 29) { - if (y < 1989) { - return "(昭和)天皇誕生日"; - } else if (y < 2007) { - return "みどりの日"; - } else { - return "昭和の日"; - } - } - break; - - case 5: - if (d == 3) { return "憲法記念日"; } - if (d == 4) { return (y >= 2007) ? "みどりの日" : "";} - if (d == 5) { return "こどもの日"; } - break; - - case 6: - break; - - case 7: - if (y >= 1995) { - if (y <= 2002) { - if (d == 20) { return "海の日"; } - } else { - if (d == getNYobi(y, 7, 3, 1)) { return "海の日"; } // 7月第3月曜日 - } - } - break; - - case 8: - break; - - case 9: - if (y >= 1966) { - if (y <= 2002) { - if (d == 15) { return "敬老の日"; } - } else { - if (d == getNYobi(y, 9, 3, 1)) { return "敬老の日"; } // 9月第3月曜日 - } - } - var nS9 = Math.floor(23.2488 + 0.242194 * (y - 1980) - Math.floor((y - 1980) / 4)); // (1980-2099まで) - if (d == nS9) { return "秋分の日"; } - break; - - case 10: - if (y >= 1966) { - if (y <= 2000) { - if (d == 10) { return "体育の日"; } - } else { - if (d == getNYobi(y, 10, 2, 1)) { return "体育の日"; } // 10月第2月曜日 - } - } - var nS9 = Math.floor(23.2488 + 0.242194 * (y - 1980) - Math.floor((y - 1980) / 4)); // (1980-2099まで) - break; - - case 11: - if (d == 3) { return "文化の日"; } - if (d == 23) { return "勤労感謝の日"; } - break; - - case 12: - if (d == 23) { return "天皇誕生日"; } - break; - - default: - break; - } - return ""; -} - - -function drawHoliday(st, ed) { - var dt = st; - var tt = dt.getTime(); - var et = ed.getTime(); - var cnt = 0; - while (tt <= et) { - var y = dt.getFullYear(); - var m = dt.getMonth() + 1; - var d = dt.getDate(); - var sHd = ""; - - sHd = getHolidayStr(y, m, d); - - if (sHd != "") { - var wCol; - if (((tt < ttStart) && (dtStart)) || ((tt > ttEnd) && (dtEnd)) || (targetM + 1 != m)) { - wCol = "#ff9999"; - } else { - wCol = "#ff0000"; - } - - document.getElementById("d" + cnt).title = sHd; - document.getElementById("d" + cnt).style.color = wCol; - if (dt.getDay() == 0) { -// if (y < 2007) { - document.getElementById("d" + (cnt + 1)).title = "振替休日"; - document.getElementById("d" + (cnt + 1)).style.color = wCol; -// } - } - - if (y >= 1986) { - if (((cnt - 2) >= 0) && (document.getElementById("d" + (cnt - 1)).title == "") && (document.getElementById("d" + (cnt - 2)).title != "")) { - if (targetM + 1 != m) { - wCol = "#ff9999"; - } else { - wCol = "#ff0000"; - } - document.getElementById("d" + (cnt - 1)).title = "国民の休日"; - document.getElementById("d" + (cnt - 1)).style.color = wCol; - } - } - - if (y >= 2007) { - // 2007年以降、祝日が日曜だったら、その後の国民の祝日でない日が振替休日になる。 - // ようするに5/3-5のどれかが日曜なら5/6が休日 - if ((m == 5) && (d >= 3) && (d <= 5)) { - if (dt.getDay() == 0) { - document.getElementById("d" + (cnt + 5 - d + 1)).title = "振替休日"; - document.getElementById("d" + (cnt + 5 - d + 1)).style.color = wCol; - } - } - } - } - - cnt++; - dt = dateAdd(dt, 1); - tt = dt.getTime(); - } -} - -// カレンダー表示 -function dispCal() { - var s =""; - var isPm = true; - var isNm = true; - - var ttToday = dtToday.getTime(); - var ttTarget = dtTarget.getTime(); - if (dtStart) { - if (ttTarget < ttStart) { - dtTarget = dtStart; - setTarget(); - } - - dtWork = new Date(targetY, targetM, 0); - if (dtWork.getTime() < ttStart) { - isPm = false; - } - } - - if (dtEnd) { - if (ttTarget > ttEnd) { - dtTarget = dtEnd; - setTarget(); - } - dtWork = new Date(targetY, targetM + 1, 1); - if (dtWork.getTime() > ttEnd) { - isNm = false; - } - } - ttTarget = dtTarget.getTime(); - - calcfirstDate(); - s += ""; - for (var y = 0; y < 7; y++) { - s += ""; - } - s += ""; -// s += ""; - - s += ""; - s += ""; - - if (isPm) { - s += ""; - s += ""; - } else { - s += ""; - s += ""; - } - - s += ""; - - if (isNm) { - s += ""; - s += ""; - } else { - s += ""; - s += ""; - } - - - s += ""; - s += ""; - for (var i = 0; i < 7; i++) { - s += ""; - } - s += ""; - var dtLast; // 第1週の日曜日 - var dt = dtFirst; // 第1週の日曜日 - var cnt = 0; - var tdyId = ""; - for (var w = 0; w < 6; w++) { // 週ごとのループ - s += ""; - for (var y = 0; y < 7; y++) { // 日~土のループ - tt = dt.getTime(); - tM = dt.getMonth(); - tD = dt.getDate(); - var sCls = "cc " + aYStl[y]; - var cTyp = ""; - if (dt.getMonth() == targetM) { - cTyp = "1"; // 当月 - } else { - cTyp = "2"; // 隣接月 - } - if (dtStart) { - if (tt < ttStart) { - cTyp = "2"; - } - } - if (dtEnd) { - if (tt > ttEnd) { - cTyp = "2"; - } - } - - sCls += cTyp; - - // 今日の日付であれば - if (tt == ttToday) { - sCls += " tdy"; // 強調 - } - if (tt == ttTarget) { - sCls += " sl1"; // 選択中(枠線) - pId = "d" + cnt; - } else { - sCls += " sl2"; // 未選択 - } - s += ""; - if (dt.getMonth() != targetM) // 週の終わりで月が変わっていたら - break; - } - s += "
" -s += ""; -s += ""; - - s += I18N.t( - "js.control.Calendar.label", - targetY, - I18N.t("js.control.Calendar.month." + targetM) - ); // targetY + "年" + targetM + "月" - -s+="
««" + I18N.t("js.control.Calendar.button.thisMonth") + "»»
" + aYStr[i] + "
"; - cnt++; - dtLast = dt; - dt = dateAdd(dt, 1); - } - s += "
"; - -// s+="
"; -// s+=""; -// s+=""; -// s+="
"; - - document.getElementById("TSCalBase").innerHTML = s; - drawHoliday(dtFirst, dtLast); - var oSelId = document.getElementById(pId); - if (oSelId != null) { - oSelId.focus(); - } -} - -function doBNwOver() { - with (document.getElementById("bNw")) { - style.backgroundColor = "#9999ff"; - style.borderStyle = "solid"; - style.borderWidth = 1; - style.borderColor = "#ffffff"; - } -} -function doBNwOut() { - with (document.getElementById("bNw")) { - style.backgroundColor = "#999999"; - style.borderStyle = "none"; - } -} - -// 初期化 -function init() { - dtStart = window.opener.getStartDate(); - dtEnd = window.opener.getEndDate(); - dtFmt = window.opener.getCalDateFormat(); - if (dtStart) { - ttStart = dtStart.getTime(); - } - if (dtEnd) { - ttEnd = dtEnd.getTime(); - } - getTargetDate(); - msgTd = I18N.t("js.control.Calendar.button.today"); // "今日(" + formatDateYMD(dtToday) + ")へ" - dispCal(); -} diff --git a/AgileWorks/WebContent/TSlib/TSCalendar.html b/AgileWorks/WebContent/TSlib/TSCalendar.html deleted file mode 100644 index 869895c53f77372c141dbe6ef7aa5899f6620f7b..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/TSCalendar.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Calendar - - - -
- diff --git a/AgileWorks/WebContent/TSlib/agileworks.js b/AgileWorks/WebContent/TSlib/agileworks.js deleted file mode 100644 index a1d0286ef762eb06ffc0d95a3011f20d0a92d51d..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/agileworks.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Copyright (C) 2008 ATLED CORP. All rights Reserved. - * - * AgileWorks dummy functions. -*/ - -AgileWorks=new function(){ - /** - * AgileWorks̃tH[ォ擾A - * 擾́Amwin servlet postp[^ɉ - * yexz - * var params=AigleWorks.getCriterionDate(); - * params["start_date"]='2008/04/01'; - * params["end_date"]='2009/03/31'; - */ - this.getCriterionDate=function(){ - var params = new Array(); - - params["CriterionDate"] = WorkflowInfo.getApplyCriterionDate(); - - return params; - }; - - return this; -}; -AgikeWorks=AgileWorks; - -/** - * vr[sJavaScriptG[Ȃ悤_~[`sB -*/ -WorkflowInfo=new function(){ - this.getDocId=function(){}; - this.getAdminNo=function(){}; - this.getApplyUserName=function(){}; - this.getApplyUnitName=function(){}; - this.getApplyDate=function(){}; - this.getApplyCriterionDate=function(){}; - this.getFixDate=function(){}; - this.getFormName=function(){}; - this.getRuleName=function(){}; - this.getOwnerName=function(){}; - this.isEditable=function(){}; - this.getStatusLabel=function(){}; - this.getCurrentNodeIndex=function(){}; - this.getCurrentNodeCode=function(){}; - this.getTaskStepCode=function(){}; - this.refresh=function(){}; - this.getDoc=function(){}; - this.getLoginAccount=function(){}; - this.getParentDoc=function(){}; - this.getOperator=function(){}; - this.getOperatorOrgUnits=function(){}; - this.getOperatorUniversalRoles=function(){}; - this.getPrincipal=function(){}; - this.getPrincipalOrgUnits=function(){}; - this.getPrincipalUniversalRoles=function(){}; - - return this; -}; - -WorkflowEvent=new function(){ - this.addEvent=function(){}; - this.removeEvent=function(){}; - this.purgeEvent=function(){}; - - return this; -}; - - -/** - * hLgr[A𑀍삷邽߂APIł. - * - * @class - * @constructor - */ -Viewer = { - - /** - * Sʉʂ\܂. - * @return void - */ - showProperty : function() { - }, - - /** - * t󋵉ʂ\܂. - * @return void - */ - showWorkflowStatus : function() { - }, - - /** - * tʂ\܂. - * @return void - */ - showWorkflowHistory : function() { - }, - - /** - * TuV[gʂ\܂. - * @return void - * @ignore - */ - showSubSheet : function() { - }, - - /** - * Ytꗗʂ\܂. - * @return void - */ - showAttachment : function() { - }, - - /** - * Rgꗗʂ\܂. - * @return void - */ - showComment : function() { - }, - - /** - * ֘Aވꗗʂ\܂. - * @return void - */ - showReference : function() { - }, - - /** - * {ꗗʂ\܂. - * @return void - */ - showViewingRights : function() { - }, - - /** - * ޗʂ\܂. - * @return void - */ - showHistory : function() { - }, - - /** - * hLgr[A‚܂. - */ - close : function() { - }, - - /** - * ݕ\Ă郌C[Sĕ‚܂. - */ - closeLayer : function() { - }, - - /** - * TCho[\܂. - */ - showSideBar : function() { - }, - - /** - * TCho[B܂. - */ - hideSideBar : function() { - } - -}; - -/* End of File */ diff --git a/AgileWorks/WebContent/TSlib/bigdecimal.js b/AgileWorks/WebContent/TSlib/bigdecimal.js deleted file mode 100644 index dd5a6de3eccbb3ccd781a5b87adbb9ea2de7d4ca..0000000000000000000000000000000000000000 --- a/AgileWorks/WebContent/TSlib/bigdecimal.js +++ /dev/null @@ -1,4987 +0,0 @@ -/* Generated from 'BigDecimal.nrx' 8 Sep 2000 11:10:50 [v2.00] */ -/* Options: Binary Comments Crossref Format Java Logo Strictargs Strictcase Trace2 Verbose3 */ -//--package com.ibm.icu.math; -//--import java.math.BigInteger; -//--import com.ibm.icu.impl.Utility; - -/* ------------------------------------------------------------------ */ -/* BigDecimal -- Decimal arithmetic for Java */ -/* ------------------------------------------------------------------ */ -/* Copyright IBM Corporation, 1996, 2000. All Rights Reserved. */ -/* */ -/* The BigDecimal class provides immutable arbitrary-precision */ -/* floating point (including integer) decimal numbers. */ -/* */ -/* As the numbers are decimal, there is an exact correspondence */ -/* between an instance of a BigDecimal object and its String */ -/* representation; the BigDecimal class provides direct conversions */ -/* to and from String and character array objects, and well as */ -/* conversions to and from the Java primitive types (which may not */ -/* be exact). */ -/* ------------------------------------------------------------------ */ -/* Notes: */ -/* */ -/* 1. A BigDecimal object is never changed in value once constructed; */ -/* this avoids the need for locking. Note in particular that the */ -/* mantissa array may be shared between many BigDecimal objects, */ -/* so that once exposed it must not be altered. */ -/* */ -/* 2. This class looks at MathContext class fields directly (for */ -/* performance). It must not and does not change them. */ -/* */ -/* 3. Exponent checking is delayed until finish(), as we know */ -/* intermediate calculations cannot cause 31-bit overflow. */ -/* [This assertion depends on MAX_DIGITS in MathContext.] */ -/* */ -/* 4. Comments for the public API now follow the javadoc conventions. */ -/* The NetRexx -comments option is used to pass these comments */ -/* through to the generated Java code (with -format, if desired). */ -/* */ -/* 5. System.arraycopy is faster than explicit loop as follows */ -/* Mean length 4: equal */ -/* Mean length 8: x2 */ -/* Mean length 16: x3 */ -/* Mean length 24: x4 */ -/* From prior experience, we expect mean length a little below 8, */ -/* but arraycopy is still the one to use, in general, until later */ -/* measurements suggest otherwise. */ -/* */ -/* 6. 'DMSRCN' referred to below is the original (1981) IBM S/370 */ -/* assembler code implementation of the algorithms below; it is */ -/* now called IXXRCN and is available with the OS/390 and VM/ESA */ -/* operating systems. */ -/* ------------------------------------------------------------------ */ -/* Change History: */ -/* 1997.09.02 Initial version (derived from netrexx.lang classes) */ -/* 1997.09.12 Add lostDigits checking */ -/* 1997.10.06 Change mantissa to a byte array */ -/* 1997.11.22 Rework power [did not prepare arguments, etc.] */ -/* 1997.12.13 multiply did not prepare arguments */ -/* 1997.12.14 add did not prepare and align arguments correctly */ -/* 1998.05.02 0.07 packaging changes suggested by Sun and Oracle */ -/* 1998.05.21 adjust remainder operator finalization */ -/* 1998.06.04 rework to pass MathContext to finish() and round() */ -/* 1998.06.06 change format to use round(); support rounding modes */ -/* 1998.06.25 rename to BigDecimal and begin merge */ -/* zero can now have trailing zeros (i.e., exp\=0) */ -/* 1998.06.28 new methods: movePointXxxx, scale, toBigInteger */ -/* unscaledValue, valueof */ -/* 1998.07.01 improve byteaddsub to allow array reuse, etc. */ -/* 1998.07.01 make null testing explicit to avoid JIT bug [Win32] */ -/* 1998.07.07 scaled division [divide(BigDecimal, int, int)] */ -/* 1998.07.08 setScale, faster equals */ -/* 1998.07.11 allow 1E6 (no sign) ; new double/float conversion */ -/* 1998.10.12 change package to com.ibm.icu.math */ -/* 1998.12.14 power operator no longer rounds RHS [to match ANSI] */ -/* add toBigDecimal() and BigDecimal(java.math.BigDecimal) */ -/* 1998.12.29 improve byteaddsub by using table lookup */ -/* 1999.02.04 lostdigits=0 behaviour rounds instead of digits+1 guard */ -/* 1999.02.05 cleaner code for BigDecimal(char[]) */ -/* 1999.02.06 add javadoc comments */ -/* 1999.02.11 format() changed from 7 to 2 method form */ -/* 1999.03.05 null pointer checking is no longer explicit */ -/* 1999.03.05 simplify; changes from discussion with J. Bloch: */ -/* null no longer permitted for MathContext; drop boolean, */ -/* byte, char, float, short constructor, deprecate double */ -/* constructor, no blanks in string constructor, add */ -/* offset and length version of char[] constructor; */ -/* add valueOf(double); drop booleanValue, charValue; */ -/* add ...Exact versions of remaining convertors */ -/* 1999.03.13 add toBigIntegerExact */ -/* 1999.03.13 1.00 release to IBM Centre for Java Technology */ -/* 1999.05.27 1.01 correct 0-0.2 bug under scaled arithmetic */ -/* 1999.06.29 1.02 constructors should not allow exponent > 9 digits */ -/* 1999.07.03 1.03 lost digits should not be checked if digits=0 */ -/* 1999.07.06 lost digits Exception message changed */ -/* 1999.07.10 1.04 more work on 0-0.2 (scaled arithmetic) */ -/* 1999.07.17 improve messages from pow method */ -/* 1999.08.08 performance tweaks */ -/* 1999.08.15 fastpath in multiply */ -/* 1999.11.05 1.05 fix problem in intValueExact [e.g., 5555555555] */ -/* 1999.12.22 1.06 remove multiply fastpath, and improve performance */ -/* 2000.01.01 copyright update [Y2K has arrived] */ -/* 2000.06.18 1.08 no longer deprecate BigDecimal(double) */ -/* ------------------------------------------------------------------ */ - -/** - * The BigDecimal class implements immutable - * arbitrary-precision decimal numbers. The methods of the - * BigDecimal class provide operations for fixed and - * floating point arithmetic, comparison, format conversions, and - * hashing. - *

- * As the numbers are decimal, there is an exact correspondence between - * an instance of a BigDecimal object and its - * String representation; the BigDecimal class - * provides direct conversions to and from String and - * character array (char[]) objects, as well as conversions - * to and from the Java primitive types (which may not be exact) and - * BigInteger. - *

- * In the descriptions of constructors and methods in this documentation, - * the value of a BigDecimal number object is shown as the - * result of invoking the toString() method on the object. - * The internal representation of a decimal number is neither defined - * nor exposed, and is not permitted to affect the result of any - * operation. - *

- * The floating point arithmetic provided by this class is defined by - * the ANSI X3.274-1996 standard, and is also documented at - * http://www2.hursley.ibm.com/decimal - *
[This URL will change.] - * - *

Operator methods

- *

- * Operations on BigDecimal numbers are controlled by a - * {@link MathContext} object, which provides the context (precision and - * other information) for the operation. Methods that can take a - * MathContext parameter implement the standard arithmetic - * operators for BigDecimal objects and are known as - * operator methods. The default settings provided by the - * constant {@link MathContext#DEFAULT} (digits=9, - * form=SCIENTIFIC, lostDigits=false, roundingMode=ROUND_HALF_UP) - * perform general-purpose floating point arithmetic to nine digits of - * precision. The MathContext parameter must not be - * null. - *

- * Each operator method also has a version provided which does - * not take a MathContext parameter. For this version of - * each method, the context settings used are digits=0, - * form=PLAIN, lostDigits=false, roundingMode=ROUND_HALF_UP; - * these settings perform fixed point arithmetic with unlimited - * precision, as defined for the original BigDecimal class in Java 1.1 - * and Java 1.2. - *

- * For monadic operators, only the optional MathContext - * parameter is present; the operation acts upon the current object. - *

- * For dyadic operators, a BigDecimal parameter is always - * present; it must not be null. - * The operation acts with the current object being the left-hand operand - * and the BigDecimal parameter being the right-hand operand. - *

- * For example, adding two BigDecimal objects referred to - * by the names award and extra could be - * written as any of: - *

- * award.add(extra) - *
award.add(extra, MathContext.DEFAULT) - *
award.add(extra, acontext) - *
- *

- * (where acontext is a MathContext object), - * which would return a BigDecimal object whose value is - * the result of adding award and extra under - * the appropriate context settings. - *

- * When a BigDecimal operator method is used, a set of - * rules define what the result will be (and, by implication, how the - * result would be represented as a character string). - * These rules are defined in the BigDecimal arithmetic documentation - * (see the URL above), but in summary: - *