id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
|---|---|---|---|---|---|---|---|---|---|---|---|
156,700
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpx/TaskModel.java
|
TaskModel.isFieldPopulated
|
@SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field)
{
boolean result = false;
if (field != null)
{
Object value = task.getCachedValue(field);
switch (field)
{
case PREDECESSORS:
case SUCCESSORS:
{
result = value != null && !((List<Relation>) value).isEmpty();
break;
}
default:
{
result = value != null;
break;
}
}
}
return result;
}
|
java
|
@SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field)
{
boolean result = false;
if (field != null)
{
Object value = task.getCachedValue(field);
switch (field)
{
case PREDECESSORS:
case SUCCESSORS:
{
result = value != null && !((List<Relation>) value).isEmpty();
break;
}
default:
{
result = value != null;
break;
}
}
}
return result;
}
|
[
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"isFieldPopulated",
"(",
"Task",
"task",
",",
"TaskField",
"field",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"Object",
"value",
"=",
"task",
".",
"getCachedValue",
"(",
"field",
")",
";",
"switch",
"(",
"field",
")",
"{",
"case",
"PREDECESSORS",
":",
"case",
"SUCCESSORS",
":",
"{",
"result",
"=",
"value",
"!=",
"null",
"&&",
"!",
"(",
"(",
"List",
"<",
"Relation",
">",
")",
"value",
")",
".",
"isEmpty",
"(",
")",
";",
"break",
";",
"}",
"default",
":",
"{",
"result",
"=",
"value",
"!=",
"null",
";",
"break",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}"
] |
Determine if a task field contains data.
@param task task instance
@param field target field
@return true if the field contains data
|
[
"Determine",
"if",
"a",
"task",
"field",
"contains",
"data",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TaskModel.java#L175-L198
|
156,701
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpx/TaskModel.java
|
TaskModel.getTaskField
|
private String getTaskField(int key)
{
String result = null;
if ((key > 0) && (key < m_taskNames.length))
{
result = m_taskNames[key];
}
return (result);
}
|
java
|
private String getTaskField(int key)
{
String result = null;
if ((key > 0) && (key < m_taskNames.length))
{
result = m_taskNames[key];
}
return (result);
}
|
[
"private",
"String",
"getTaskField",
"(",
"int",
"key",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"(",
"key",
">",
"0",
")",
"&&",
"(",
"key",
"<",
"m_taskNames",
".",
"length",
")",
")",
"{",
"result",
"=",
"m_taskNames",
"[",
"key",
"]",
";",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Returns Task field name of supplied code no.
@param key - the code no of required Task field
@return - field name
|
[
"Returns",
"Task",
"field",
"name",
"of",
"supplied",
"code",
"no",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TaskModel.java#L245-L255
|
156,702
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpx/TaskModel.java
|
TaskModel.getTaskCode
|
private int getTaskCode(String field) throws MPXJException
{
Integer result = m_taskNumbers.get(field.trim());
if (result == null)
{
throw new MPXJException(MPXJException.INVALID_TASK_FIELD_NAME + " " + field);
}
return (result.intValue());
}
|
java
|
private int getTaskCode(String field) throws MPXJException
{
Integer result = m_taskNumbers.get(field.trim());
if (result == null)
{
throw new MPXJException(MPXJException.INVALID_TASK_FIELD_NAME + " " + field);
}
return (result.intValue());
}
|
[
"private",
"int",
"getTaskCode",
"(",
"String",
"field",
")",
"throws",
"MPXJException",
"{",
"Integer",
"result",
"=",
"m_taskNumbers",
".",
"get",
"(",
"field",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"MPXJException",
"(",
"MPXJException",
".",
"INVALID_TASK_FIELD_NAME",
"+",
"\" \"",
"+",
"field",
")",
";",
"}",
"return",
"(",
"result",
".",
"intValue",
"(",
")",
")",
";",
"}"
] |
Returns code number of Task field supplied.
@param field - name
@return - code no
|
[
"Returns",
"code",
"number",
"of",
"Task",
"field",
"supplied",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TaskModel.java#L263-L273
|
156,703
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/DatatypeConverter.java
|
DatatypeConverter.parseString
|
public static String parseString(String value)
{
if (value != null)
{
// Strip angle brackets if present
if (!value.isEmpty() && value.charAt(0) == '<')
{
value = value.substring(1, value.length() - 1);
}
// Strip quotes if present
if (!value.isEmpty() && value.charAt(0) == '"')
{
value = value.substring(1, value.length() - 1);
}
}
return value;
}
|
java
|
public static String parseString(String value)
{
if (value != null)
{
// Strip angle brackets if present
if (!value.isEmpty() && value.charAt(0) == '<')
{
value = value.substring(1, value.length() - 1);
}
// Strip quotes if present
if (!value.isEmpty() && value.charAt(0) == '"')
{
value = value.substring(1, value.length() - 1);
}
}
return value;
}
|
[
"public",
"static",
"String",
"parseString",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"// Strip angle brackets if present",
"if",
"(",
"!",
"value",
".",
"isEmpty",
"(",
")",
"&&",
"value",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
")",
"{",
"value",
"=",
"value",
".",
"substring",
"(",
"1",
",",
"value",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"}",
"// Strip quotes if present",
"if",
"(",
"!",
"value",
".",
"isEmpty",
"(",
")",
"&&",
"value",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
")",
"{",
"value",
"=",
"value",
".",
"substring",
"(",
"1",
",",
"value",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"}",
"}",
"return",
"value",
";",
"}"
] |
Parse a string.
@param value string representation
@return String value
|
[
"Parse",
"a",
"string",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/DatatypeConverter.java#L46-L63
|
156,704
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/DatatypeConverter.java
|
DatatypeConverter.parseDouble
|
public static Number parseDouble(String value) throws ParseException
{
Number result = null;
value = parseString(value);
// If we still have a value
if (value != null && !value.isEmpty() && !value.equals("-1 -1"))
{
int index = value.indexOf("E+");
if (index != -1)
{
value = value.substring(0, index) + 'E' + value.substring(index + 2, value.length());
}
if (value.indexOf('E') != -1)
{
result = DOUBLE_FORMAT.get().parse(value);
}
else
{
result = Double.valueOf(value);
}
}
return result;
}
|
java
|
public static Number parseDouble(String value) throws ParseException
{
Number result = null;
value = parseString(value);
// If we still have a value
if (value != null && !value.isEmpty() && !value.equals("-1 -1"))
{
int index = value.indexOf("E+");
if (index != -1)
{
value = value.substring(0, index) + 'E' + value.substring(index + 2, value.length());
}
if (value.indexOf('E') != -1)
{
result = DOUBLE_FORMAT.get().parse(value);
}
else
{
result = Double.valueOf(value);
}
}
return result;
}
|
[
"public",
"static",
"Number",
"parseDouble",
"(",
"String",
"value",
")",
"throws",
"ParseException",
"{",
"Number",
"result",
"=",
"null",
";",
"value",
"=",
"parseString",
"(",
"value",
")",
";",
"// If we still have a value",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"value",
".",
"equals",
"(",
"\"-1 -1\"",
")",
")",
"{",
"int",
"index",
"=",
"value",
".",
"indexOf",
"(",
"\"E+\"",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"value",
"=",
"value",
".",
"substring",
"(",
"0",
",",
"index",
")",
"+",
"'",
"'",
"+",
"value",
".",
"substring",
"(",
"index",
"+",
"2",
",",
"value",
".",
"length",
"(",
")",
")",
";",
"}",
"if",
"(",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"result",
"=",
"DOUBLE_FORMAT",
".",
"get",
"(",
")",
".",
"parse",
"(",
"value",
")",
";",
"}",
"else",
"{",
"result",
"=",
"Double",
".",
"valueOf",
"(",
"value",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] |
Parse the string representation of a double.
@param value string representation
@return Java representation
@throws ParseException
|
[
"Parse",
"the",
"string",
"representation",
"of",
"a",
"double",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/DatatypeConverter.java#L72-L98
|
156,705
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/DatatypeConverter.java
|
DatatypeConverter.parseBoolean
|
public static Boolean parseBoolean(String value) throws ParseException
{
Boolean result = null;
Integer number = parseInteger(value);
if (number != null)
{
result = number.intValue() == 0 ? Boolean.FALSE : Boolean.TRUE;
}
return result;
}
|
java
|
public static Boolean parseBoolean(String value) throws ParseException
{
Boolean result = null;
Integer number = parseInteger(value);
if (number != null)
{
result = number.intValue() == 0 ? Boolean.FALSE : Boolean.TRUE;
}
return result;
}
|
[
"public",
"static",
"Boolean",
"parseBoolean",
"(",
"String",
"value",
")",
"throws",
"ParseException",
"{",
"Boolean",
"result",
"=",
"null",
";",
"Integer",
"number",
"=",
"parseInteger",
"(",
"value",
")",
";",
"if",
"(",
"number",
"!=",
"null",
")",
"{",
"result",
"=",
"number",
".",
"intValue",
"(",
")",
"==",
"0",
"?",
"Boolean",
".",
"FALSE",
":",
"Boolean",
".",
"TRUE",
";",
"}",
"return",
"result",
";",
"}"
] |
Parse a string representation of a Boolean value.
@param value string representation
@return Boolean value
|
[
"Parse",
"a",
"string",
"representation",
"of",
"a",
"Boolean",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/DatatypeConverter.java#L106-L116
|
156,706
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/DatatypeConverter.java
|
DatatypeConverter.parseInteger
|
public static Integer parseInteger(String value) throws ParseException
{
Integer result = null;
if (value.length() > 0 && value.indexOf(' ') == -1)
{
if (value.indexOf('.') == -1)
{
result = Integer.valueOf(value);
}
else
{
Number n = DatatypeConverter.parseDouble(value);
result = Integer.valueOf(n.intValue());
}
}
return result;
}
|
java
|
public static Integer parseInteger(String value) throws ParseException
{
Integer result = null;
if (value.length() > 0 && value.indexOf(' ') == -1)
{
if (value.indexOf('.') == -1)
{
result = Integer.valueOf(value);
}
else
{
Number n = DatatypeConverter.parseDouble(value);
result = Integer.valueOf(n.intValue());
}
}
return result;
}
|
[
"public",
"static",
"Integer",
"parseInteger",
"(",
"String",
"value",
")",
"throws",
"ParseException",
"{",
"Integer",
"result",
"=",
"null",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
"&&",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"if",
"(",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"result",
"=",
"Integer",
".",
"valueOf",
"(",
"value",
")",
";",
"}",
"else",
"{",
"Number",
"n",
"=",
"DatatypeConverter",
".",
"parseDouble",
"(",
"value",
")",
";",
"result",
"=",
"Integer",
".",
"valueOf",
"(",
"n",
".",
"intValue",
"(",
")",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] |
Parse a string representation of an Integer value.
@param value string representation
@return Integer value
|
[
"Parse",
"a",
"string",
"representation",
"of",
"an",
"Integer",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/DatatypeConverter.java#L124-L142
|
156,707
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/DatatypeConverter.java
|
DatatypeConverter.parseEpochTimestamp
|
public static Date parseEpochTimestamp(String value)
{
Date result = null;
if (value.length() > 0)
{
if (!value.equals("-1 -1"))
{
Calendar cal = DateHelper.popCalendar(JAVA_EPOCH);
int index = value.indexOf(' ');
if (index == -1)
{
if (value.length() < 6)
{
value = "000000" + value;
value = value.substring(value.length() - 6);
}
int hours = Integer.parseInt(value.substring(0, 2));
int minutes = Integer.parseInt(value.substring(2, 4));
int seconds = Integer.parseInt(value.substring(4));
cal.set(Calendar.HOUR, hours);
cal.set(Calendar.MINUTE, minutes);
cal.set(Calendar.SECOND, seconds);
}
else
{
long astaDays = Long.parseLong(value.substring(0, index));
int astaSeconds = Integer.parseInt(value.substring(index + 1));
cal.add(Calendar.DAY_OF_YEAR, (int) (astaDays - ASTA_EPOCH));
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.HOUR, 0);
cal.add(Calendar.SECOND, astaSeconds);
}
result = cal.getTime();
DateHelper.pushCalendar(cal);
}
}
return result;
}
|
java
|
public static Date parseEpochTimestamp(String value)
{
Date result = null;
if (value.length() > 0)
{
if (!value.equals("-1 -1"))
{
Calendar cal = DateHelper.popCalendar(JAVA_EPOCH);
int index = value.indexOf(' ');
if (index == -1)
{
if (value.length() < 6)
{
value = "000000" + value;
value = value.substring(value.length() - 6);
}
int hours = Integer.parseInt(value.substring(0, 2));
int minutes = Integer.parseInt(value.substring(2, 4));
int seconds = Integer.parseInt(value.substring(4));
cal.set(Calendar.HOUR, hours);
cal.set(Calendar.MINUTE, minutes);
cal.set(Calendar.SECOND, seconds);
}
else
{
long astaDays = Long.parseLong(value.substring(0, index));
int astaSeconds = Integer.parseInt(value.substring(index + 1));
cal.add(Calendar.DAY_OF_YEAR, (int) (astaDays - ASTA_EPOCH));
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.HOUR, 0);
cal.add(Calendar.SECOND, astaSeconds);
}
result = cal.getTime();
DateHelper.pushCalendar(cal);
}
}
return result;
}
|
[
"public",
"static",
"Date",
"parseEpochTimestamp",
"(",
"String",
"value",
")",
"{",
"Date",
"result",
"=",
"null",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"value",
".",
"equals",
"(",
"\"-1 -1\"",
")",
")",
"{",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
"(",
"JAVA_EPOCH",
")",
";",
"int",
"index",
"=",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
"value",
".",
"length",
"(",
")",
"<",
"6",
")",
"{",
"value",
"=",
"\"000000\"",
"+",
"value",
";",
"value",
"=",
"value",
".",
"substring",
"(",
"value",
".",
"length",
"(",
")",
"-",
"6",
")",
";",
"}",
"int",
"hours",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
".",
"substring",
"(",
"0",
",",
"2",
")",
")",
";",
"int",
"minutes",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
".",
"substring",
"(",
"2",
",",
"4",
")",
")",
";",
"int",
"seconds",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
".",
"substring",
"(",
"4",
")",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOUR",
",",
"hours",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"MINUTE",
",",
"minutes",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"SECOND",
",",
"seconds",
")",
";",
"}",
"else",
"{",
"long",
"astaDays",
"=",
"Long",
".",
"parseLong",
"(",
"value",
".",
"substring",
"(",
"0",
",",
"index",
")",
")",
";",
"int",
"astaSeconds",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
".",
"substring",
"(",
"index",
"+",
"1",
")",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"DAY_OF_YEAR",
",",
"(",
"int",
")",
"(",
"astaDays",
"-",
"ASTA_EPOCH",
")",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"MILLISECOND",
",",
"0",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"SECOND",
",",
"0",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOUR",
",",
"0",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"SECOND",
",",
"astaSeconds",
")",
";",
"}",
"result",
"=",
"cal",
".",
"getTime",
"(",
")",
";",
"DateHelper",
".",
"pushCalendar",
"(",
"cal",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] |
Parse the string representation of a timestamp.
@param value string representation
@return Java representation
|
[
"Parse",
"the",
"string",
"representation",
"of",
"a",
"timestamp",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/DatatypeConverter.java#L150-L195
|
156,708
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processProjectListItem
|
protected void processProjectListItem(Map<Integer, String> result, Row row)
{
Integer id = row.getInteger("PROJ_ID");
String name = row.getString("PROJ_NAME");
result.put(id, name);
}
|
java
|
protected void processProjectListItem(Map<Integer, String> result, Row row)
{
Integer id = row.getInteger("PROJ_ID");
String name = row.getString("PROJ_NAME");
result.put(id, name);
}
|
[
"protected",
"void",
"processProjectListItem",
"(",
"Map",
"<",
"Integer",
",",
"String",
">",
"result",
",",
"Row",
"row",
")",
"{",
"Integer",
"id",
"=",
"row",
".",
"getInteger",
"(",
"\"PROJ_ID\"",
")",
";",
"String",
"name",
"=",
"row",
".",
"getString",
"(",
"\"PROJ_NAME\"",
")",
";",
"result",
".",
"put",
"(",
"id",
",",
"name",
")",
";",
"}"
] |
Retrieve the details of a single project from the database.
@param result Map instance containing the results
@param row result set row read from the database
|
[
"Retrieve",
"the",
"details",
"of",
"a",
"single",
"project",
"from",
"the",
"database",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L92-L97
|
156,709
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processCalendarData
|
protected void processCalendarData(ProjectCalendar calendar, Row row)
{
int dayIndex = row.getInt("CD_DAY_OR_EXCEPTION");
if (dayIndex == 0)
{
processCalendarException(calendar, row);
}
else
{
processCalendarHours(calendar, row, dayIndex);
}
}
|
java
|
protected void processCalendarData(ProjectCalendar calendar, Row row)
{
int dayIndex = row.getInt("CD_DAY_OR_EXCEPTION");
if (dayIndex == 0)
{
processCalendarException(calendar, row);
}
else
{
processCalendarHours(calendar, row, dayIndex);
}
}
|
[
"protected",
"void",
"processCalendarData",
"(",
"ProjectCalendar",
"calendar",
",",
"Row",
"row",
")",
"{",
"int",
"dayIndex",
"=",
"row",
".",
"getInt",
"(",
"\"CD_DAY_OR_EXCEPTION\"",
")",
";",
"if",
"(",
"dayIndex",
"==",
"0",
")",
"{",
"processCalendarException",
"(",
"calendar",
",",
"row",
")",
";",
"}",
"else",
"{",
"processCalendarHours",
"(",
"calendar",
",",
"row",
",",
"dayIndex",
")",
";",
"}",
"}"
] |
Read calendar hours and exception data.
@param calendar parent calendar
@param row calendar hours and exception data
|
[
"Read",
"calendar",
"hours",
"and",
"exception",
"data",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L272-L283
|
156,710
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processCalendarException
|
private void processCalendarException(ProjectCalendar calendar, Row row)
{
Date fromDate = row.getDate("CD_FROM_DATE");
Date toDate = row.getDate("CD_TO_DATE");
boolean working = row.getInt("CD_WORKING") != 0;
ProjectCalendarException exception = calendar.addCalendarException(fromDate, toDate);
if (working)
{
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME1"), row.getDate("CD_TO_TIME1")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME2"), row.getDate("CD_TO_TIME2")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME3"), row.getDate("CD_TO_TIME3")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME4"), row.getDate("CD_TO_TIME4")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME5"), row.getDate("CD_TO_TIME5")));
}
}
|
java
|
private void processCalendarException(ProjectCalendar calendar, Row row)
{
Date fromDate = row.getDate("CD_FROM_DATE");
Date toDate = row.getDate("CD_TO_DATE");
boolean working = row.getInt("CD_WORKING") != 0;
ProjectCalendarException exception = calendar.addCalendarException(fromDate, toDate);
if (working)
{
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME1"), row.getDate("CD_TO_TIME1")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME2"), row.getDate("CD_TO_TIME2")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME3"), row.getDate("CD_TO_TIME3")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME4"), row.getDate("CD_TO_TIME4")));
exception.addRange(new DateRange(row.getDate("CD_FROM_TIME5"), row.getDate("CD_TO_TIME5")));
}
}
|
[
"private",
"void",
"processCalendarException",
"(",
"ProjectCalendar",
"calendar",
",",
"Row",
"row",
")",
"{",
"Date",
"fromDate",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_DATE\"",
")",
";",
"Date",
"toDate",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_DATE\"",
")",
";",
"boolean",
"working",
"=",
"row",
".",
"getInt",
"(",
"\"CD_WORKING\"",
")",
"!=",
"0",
";",
"ProjectCalendarException",
"exception",
"=",
"calendar",
".",
"addCalendarException",
"(",
"fromDate",
",",
"toDate",
")",
";",
"if",
"(",
"working",
")",
"{",
"exception",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME1\"",
")",
",",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME1\"",
")",
")",
")",
";",
"exception",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME2\"",
")",
",",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME2\"",
")",
")",
")",
";",
"exception",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME3\"",
")",
",",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME3\"",
")",
")",
")",
";",
"exception",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME4\"",
")",
",",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME4\"",
")",
")",
")",
";",
"exception",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME5\"",
")",
",",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME5\"",
")",
")",
")",
";",
"}",
"}"
] |
Process a calendar exception.
@param calendar parent calendar
@param row calendar exception data
|
[
"Process",
"a",
"calendar",
"exception",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L291-L305
|
156,711
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processCalendarHours
|
private void processCalendarHours(ProjectCalendar calendar, Row row, int dayIndex)
{
Day day = Day.getInstance(dayIndex);
boolean working = row.getInt("CD_WORKING") != 0;
calendar.setWorkingDay(day, working);
if (working == true)
{
ProjectCalendarHours hours = calendar.addCalendarHours(day);
Date start = row.getDate("CD_FROM_TIME1");
Date end = row.getDate("CD_TO_TIME1");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME2");
end = row.getDate("CD_TO_TIME2");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME3");
end = row.getDate("CD_TO_TIME3");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME4");
end = row.getDate("CD_TO_TIME4");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME5");
end = row.getDate("CD_TO_TIME5");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
}
}
|
java
|
private void processCalendarHours(ProjectCalendar calendar, Row row, int dayIndex)
{
Day day = Day.getInstance(dayIndex);
boolean working = row.getInt("CD_WORKING") != 0;
calendar.setWorkingDay(day, working);
if (working == true)
{
ProjectCalendarHours hours = calendar.addCalendarHours(day);
Date start = row.getDate("CD_FROM_TIME1");
Date end = row.getDate("CD_TO_TIME1");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME2");
end = row.getDate("CD_TO_TIME2");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME3");
end = row.getDate("CD_TO_TIME3");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME4");
end = row.getDate("CD_TO_TIME4");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
start = row.getDate("CD_FROM_TIME5");
end = row.getDate("CD_TO_TIME5");
if (start != null && end != null)
{
hours.addRange(new DateRange(start, end));
}
}
}
|
[
"private",
"void",
"processCalendarHours",
"(",
"ProjectCalendar",
"calendar",
",",
"Row",
"row",
",",
"int",
"dayIndex",
")",
"{",
"Day",
"day",
"=",
"Day",
".",
"getInstance",
"(",
"dayIndex",
")",
";",
"boolean",
"working",
"=",
"row",
".",
"getInt",
"(",
"\"CD_WORKING\"",
")",
"!=",
"0",
";",
"calendar",
".",
"setWorkingDay",
"(",
"day",
",",
"working",
")",
";",
"if",
"(",
"working",
"==",
"true",
")",
"{",
"ProjectCalendarHours",
"hours",
"=",
"calendar",
".",
"addCalendarHours",
"(",
"day",
")",
";",
"Date",
"start",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME1\"",
")",
";",
"Date",
"end",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME1\"",
")",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"hours",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"start",
",",
"end",
")",
")",
";",
"}",
"start",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME2\"",
")",
";",
"end",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME2\"",
")",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"hours",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"start",
",",
"end",
")",
")",
";",
"}",
"start",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME3\"",
")",
";",
"end",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME3\"",
")",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"hours",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"start",
",",
"end",
")",
")",
";",
"}",
"start",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME4\"",
")",
";",
"end",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME4\"",
")",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"hours",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"start",
",",
"end",
")",
")",
";",
"}",
"start",
"=",
"row",
".",
"getDate",
"(",
"\"CD_FROM_TIME5\"",
")",
";",
"end",
"=",
"row",
".",
"getDate",
"(",
"\"CD_TO_TIME5\"",
")",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"hours",
".",
"addRange",
"(",
"new",
"DateRange",
"(",
"start",
",",
"end",
")",
")",
";",
"}",
"}",
"}"
] |
Process calendar hours.
@param calendar parent calendar
@param row calendar hours data
@param dayIndex day index
|
[
"Process",
"calendar",
"hours",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L314-L358
|
156,712
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processResourceBaseline
|
protected void processResourceBaseline(Row row)
{
Integer id = row.getInteger("RES_UID");
Resource resource = m_project.getResourceByUniqueID(id);
if (resource != null)
{
int index = row.getInt("RB_BASE_NUM");
resource.setBaselineWork(index, row.getDuration("RB_BASE_WORK"));
resource.setBaselineCost(index, row.getCurrency("RB_BASE_COST"));
}
}
|
java
|
protected void processResourceBaseline(Row row)
{
Integer id = row.getInteger("RES_UID");
Resource resource = m_project.getResourceByUniqueID(id);
if (resource != null)
{
int index = row.getInt("RB_BASE_NUM");
resource.setBaselineWork(index, row.getDuration("RB_BASE_WORK"));
resource.setBaselineCost(index, row.getCurrency("RB_BASE_COST"));
}
}
|
[
"protected",
"void",
"processResourceBaseline",
"(",
"Row",
"row",
")",
"{",
"Integer",
"id",
"=",
"row",
".",
"getInteger",
"(",
"\"RES_UID\"",
")",
";",
"Resource",
"resource",
"=",
"m_project",
".",
"getResourceByUniqueID",
"(",
"id",
")",
";",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"int",
"index",
"=",
"row",
".",
"getInt",
"(",
"\"RB_BASE_NUM\"",
")",
";",
"resource",
".",
"setBaselineWork",
"(",
"index",
",",
"row",
".",
"getDuration",
"(",
"\"RB_BASE_WORK\"",
")",
")",
";",
"resource",
".",
"setBaselineCost",
"(",
"index",
",",
"row",
".",
"getCurrency",
"(",
"\"RB_BASE_COST\"",
")",
")",
";",
"}",
"}"
] |
Read resource baseline values.
@param row result set row
|
[
"Read",
"resource",
"baseline",
"values",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L634-L645
|
156,713
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processDurationField
|
protected void processDurationField(Row row)
{
processField(row, "DUR_FIELD_ID", "DUR_REF_UID", MPDUtility.getAdjustedDuration(m_project, row.getInt("DUR_VALUE"), MPDUtility.getDurationTimeUnits(row.getInt("DUR_FMT"))));
}
|
java
|
protected void processDurationField(Row row)
{
processField(row, "DUR_FIELD_ID", "DUR_REF_UID", MPDUtility.getAdjustedDuration(m_project, row.getInt("DUR_VALUE"), MPDUtility.getDurationTimeUnits(row.getInt("DUR_FMT"))));
}
|
[
"protected",
"void",
"processDurationField",
"(",
"Row",
"row",
")",
"{",
"processField",
"(",
"row",
",",
"\"DUR_FIELD_ID\"",
",",
"\"DUR_REF_UID\"",
",",
"MPDUtility",
".",
"getAdjustedDuration",
"(",
"m_project",
",",
"row",
".",
"getInt",
"(",
"\"DUR_VALUE\"",
")",
",",
"MPDUtility",
".",
"getDurationTimeUnits",
"(",
"row",
".",
"getInt",
"(",
"\"DUR_FMT\"",
")",
")",
")",
")",
";",
"}"
] |
Read a single duration field extended attribute.
@param row field data
|
[
"Read",
"a",
"single",
"duration",
"field",
"extended",
"attribute",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L682-L685
|
156,714
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processOutlineCodeField
|
protected void processOutlineCodeField(Integer entityID, Row row)
{
processField(row, "OC_FIELD_ID", entityID, row.getString("OC_NAME"));
}
|
java
|
protected void processOutlineCodeField(Integer entityID, Row row)
{
processField(row, "OC_FIELD_ID", entityID, row.getString("OC_NAME"));
}
|
[
"protected",
"void",
"processOutlineCodeField",
"(",
"Integer",
"entityID",
",",
"Row",
"row",
")",
"{",
"processField",
"(",
"row",
",",
"\"OC_FIELD_ID\"",
",",
"entityID",
",",
"row",
".",
"getString",
"(",
"\"OC_NAME\"",
")",
")",
";",
"}"
] |
Read a single outline code field extended attribute.
@param entityID parent entity
@param row field data
|
[
"Read",
"a",
"single",
"outline",
"code",
"field",
"extended",
"attribute",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L703-L706
|
156,715
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processTaskBaseline
|
protected void processTaskBaseline(Row row)
{
Integer id = row.getInteger("TASK_UID");
Task task = m_project.getTaskByUniqueID(id);
if (task != null)
{
int index = row.getInt("TB_BASE_NUM");
task.setBaselineDuration(index, MPDUtility.getAdjustedDuration(m_project, row.getInt("TB_BASE_DUR"), MPDUtility.getDurationTimeUnits(row.getInt("TB_BASE_DUR_FMT"))));
task.setBaselineStart(index, row.getDate("TB_BASE_START"));
task.setBaselineFinish(index, row.getDate("TB_BASE_FINISH"));
task.setBaselineWork(index, row.getDuration("TB_BASE_WORK"));
task.setBaselineCost(index, row.getCurrency("TB_BASE_COST"));
}
}
|
java
|
protected void processTaskBaseline(Row row)
{
Integer id = row.getInteger("TASK_UID");
Task task = m_project.getTaskByUniqueID(id);
if (task != null)
{
int index = row.getInt("TB_BASE_NUM");
task.setBaselineDuration(index, MPDUtility.getAdjustedDuration(m_project, row.getInt("TB_BASE_DUR"), MPDUtility.getDurationTimeUnits(row.getInt("TB_BASE_DUR_FMT"))));
task.setBaselineStart(index, row.getDate("TB_BASE_START"));
task.setBaselineFinish(index, row.getDate("TB_BASE_FINISH"));
task.setBaselineWork(index, row.getDuration("TB_BASE_WORK"));
task.setBaselineCost(index, row.getCurrency("TB_BASE_COST"));
}
}
|
[
"protected",
"void",
"processTaskBaseline",
"(",
"Row",
"row",
")",
"{",
"Integer",
"id",
"=",
"row",
".",
"getInteger",
"(",
"\"TASK_UID\"",
")",
";",
"Task",
"task",
"=",
"m_project",
".",
"getTaskByUniqueID",
"(",
"id",
")",
";",
"if",
"(",
"task",
"!=",
"null",
")",
"{",
"int",
"index",
"=",
"row",
".",
"getInt",
"(",
"\"TB_BASE_NUM\"",
")",
";",
"task",
".",
"setBaselineDuration",
"(",
"index",
",",
"MPDUtility",
".",
"getAdjustedDuration",
"(",
"m_project",
",",
"row",
".",
"getInt",
"(",
"\"TB_BASE_DUR\"",
")",
",",
"MPDUtility",
".",
"getDurationTimeUnits",
"(",
"row",
".",
"getInt",
"(",
"\"TB_BASE_DUR_FMT\"",
")",
")",
")",
")",
";",
"task",
".",
"setBaselineStart",
"(",
"index",
",",
"row",
".",
"getDate",
"(",
"\"TB_BASE_START\"",
")",
")",
";",
"task",
".",
"setBaselineFinish",
"(",
"index",
",",
"row",
".",
"getDate",
"(",
"\"TB_BASE_FINISH\"",
")",
")",
";",
"task",
".",
"setBaselineWork",
"(",
"index",
",",
"row",
".",
"getDuration",
"(",
"\"TB_BASE_WORK\"",
")",
")",
";",
"task",
".",
"setBaselineCost",
"(",
"index",
",",
"row",
".",
"getCurrency",
"(",
"\"TB_BASE_COST\"",
")",
")",
";",
"}",
"}"
] |
Read task baseline values.
@param row result set row
|
[
"Read",
"task",
"baseline",
"values",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1100-L1114
|
156,716
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processLink
|
protected void processLink(Row row)
{
Task predecessorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_PRED_UID"));
Task successorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_SUCC_UID"));
if (predecessorTask != null && successorTask != null)
{
RelationType type = RelationType.getInstance(row.getInt("LINK_TYPE"));
TimeUnit durationUnits = MPDUtility.getDurationTimeUnits(row.getInt("LINK_LAG_FMT"));
Duration duration = MPDUtility.getDuration(row.getDouble("LINK_LAG").doubleValue(), durationUnits);
Relation relation = successorTask.addPredecessor(predecessorTask, type, duration);
relation.setUniqueID(row.getInteger("LINK_UID"));
m_eventManager.fireRelationReadEvent(relation);
}
}
|
java
|
protected void processLink(Row row)
{
Task predecessorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_PRED_UID"));
Task successorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_SUCC_UID"));
if (predecessorTask != null && successorTask != null)
{
RelationType type = RelationType.getInstance(row.getInt("LINK_TYPE"));
TimeUnit durationUnits = MPDUtility.getDurationTimeUnits(row.getInt("LINK_LAG_FMT"));
Duration duration = MPDUtility.getDuration(row.getDouble("LINK_LAG").doubleValue(), durationUnits);
Relation relation = successorTask.addPredecessor(predecessorTask, type, duration);
relation.setUniqueID(row.getInteger("LINK_UID"));
m_eventManager.fireRelationReadEvent(relation);
}
}
|
[
"protected",
"void",
"processLink",
"(",
"Row",
"row",
")",
"{",
"Task",
"predecessorTask",
"=",
"m_project",
".",
"getTaskByUniqueID",
"(",
"row",
".",
"getInteger",
"(",
"\"LINK_PRED_UID\"",
")",
")",
";",
"Task",
"successorTask",
"=",
"m_project",
".",
"getTaskByUniqueID",
"(",
"row",
".",
"getInteger",
"(",
"\"LINK_SUCC_UID\"",
")",
")",
";",
"if",
"(",
"predecessorTask",
"!=",
"null",
"&&",
"successorTask",
"!=",
"null",
")",
"{",
"RelationType",
"type",
"=",
"RelationType",
".",
"getInstance",
"(",
"row",
".",
"getInt",
"(",
"\"LINK_TYPE\"",
")",
")",
";",
"TimeUnit",
"durationUnits",
"=",
"MPDUtility",
".",
"getDurationTimeUnits",
"(",
"row",
".",
"getInt",
"(",
"\"LINK_LAG_FMT\"",
")",
")",
";",
"Duration",
"duration",
"=",
"MPDUtility",
".",
"getDuration",
"(",
"row",
".",
"getDouble",
"(",
"\"LINK_LAG\"",
")",
".",
"doubleValue",
"(",
")",
",",
"durationUnits",
")",
";",
"Relation",
"relation",
"=",
"successorTask",
".",
"addPredecessor",
"(",
"predecessorTask",
",",
"type",
",",
"duration",
")",
";",
"relation",
".",
"setUniqueID",
"(",
"row",
".",
"getInteger",
"(",
"\"LINK_UID\"",
")",
")",
";",
"m_eventManager",
".",
"fireRelationReadEvent",
"(",
"relation",
")",
";",
"}",
"}"
] |
Process a relationship between two tasks.
@param row relationship data
|
[
"Process",
"a",
"relationship",
"between",
"two",
"tasks",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1121-L1134
|
156,717
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.processAssignmentBaseline
|
protected void processAssignmentBaseline(Row row)
{
Integer id = row.getInteger("ASSN_UID");
ResourceAssignment assignment = m_assignmentMap.get(id);
if (assignment != null)
{
int index = row.getInt("AB_BASE_NUM");
assignment.setBaselineStart(index, row.getDate("AB_BASE_START"));
assignment.setBaselineFinish(index, row.getDate("AB_BASE_FINISH"));
assignment.setBaselineWork(index, row.getDuration("AB_BASE_WORK"));
assignment.setBaselineCost(index, row.getCurrency("AB_BASE_COST"));
}
}
|
java
|
protected void processAssignmentBaseline(Row row)
{
Integer id = row.getInteger("ASSN_UID");
ResourceAssignment assignment = m_assignmentMap.get(id);
if (assignment != null)
{
int index = row.getInt("AB_BASE_NUM");
assignment.setBaselineStart(index, row.getDate("AB_BASE_START"));
assignment.setBaselineFinish(index, row.getDate("AB_BASE_FINISH"));
assignment.setBaselineWork(index, row.getDuration("AB_BASE_WORK"));
assignment.setBaselineCost(index, row.getCurrency("AB_BASE_COST"));
}
}
|
[
"protected",
"void",
"processAssignmentBaseline",
"(",
"Row",
"row",
")",
"{",
"Integer",
"id",
"=",
"row",
".",
"getInteger",
"(",
"\"ASSN_UID\"",
")",
";",
"ResourceAssignment",
"assignment",
"=",
"m_assignmentMap",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"assignment",
"!=",
"null",
")",
"{",
"int",
"index",
"=",
"row",
".",
"getInt",
"(",
"\"AB_BASE_NUM\"",
")",
";",
"assignment",
".",
"setBaselineStart",
"(",
"index",
",",
"row",
".",
"getDate",
"(",
"\"AB_BASE_START\"",
")",
")",
";",
"assignment",
".",
"setBaselineFinish",
"(",
"index",
",",
"row",
".",
"getDate",
"(",
"\"AB_BASE_FINISH\"",
")",
")",
";",
"assignment",
".",
"setBaselineWork",
"(",
"index",
",",
"row",
".",
"getDuration",
"(",
"\"AB_BASE_WORK\"",
")",
")",
";",
"assignment",
".",
"setBaselineCost",
"(",
"index",
",",
"row",
".",
"getCurrency",
"(",
"\"AB_BASE_COST\"",
")",
")",
";",
"}",
"}"
] |
Read resource assignment baseline values.
@param row result set row
|
[
"Read",
"resource",
"assignment",
"baseline",
"values",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1217-L1230
|
156,718
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.postProcessing
|
protected void postProcessing()
{
//
// Update the internal structure. We'll take this opportunity to
// generate outline numbers for the tasks as they don't appear to
// be present in the MPP file.
//
ProjectConfig config = m_project.getProjectConfig();
config.setAutoWBS(m_autoWBS);
config.setAutoOutlineNumber(true);
m_project.updateStructure();
config.setAutoOutlineNumber(false);
//
// Perform post-processing to set the summary flag
//
for (Task task : m_project.getTasks())
{
task.setSummary(task.hasChildTasks());
}
//
// Ensure that the unique ID counters are correct
//
config.updateUniqueCounters();
}
|
java
|
protected void postProcessing()
{
//
// Update the internal structure. We'll take this opportunity to
// generate outline numbers for the tasks as they don't appear to
// be present in the MPP file.
//
ProjectConfig config = m_project.getProjectConfig();
config.setAutoWBS(m_autoWBS);
config.setAutoOutlineNumber(true);
m_project.updateStructure();
config.setAutoOutlineNumber(false);
//
// Perform post-processing to set the summary flag
//
for (Task task : m_project.getTasks())
{
task.setSummary(task.hasChildTasks());
}
//
// Ensure that the unique ID counters are correct
//
config.updateUniqueCounters();
}
|
[
"protected",
"void",
"postProcessing",
"(",
")",
"{",
"//",
"// Update the internal structure. We'll take this opportunity to",
"// generate outline numbers for the tasks as they don't appear to",
"// be present in the MPP file.",
"//",
"ProjectConfig",
"config",
"=",
"m_project",
".",
"getProjectConfig",
"(",
")",
";",
"config",
".",
"setAutoWBS",
"(",
"m_autoWBS",
")",
";",
"config",
".",
"setAutoOutlineNumber",
"(",
"true",
")",
";",
"m_project",
".",
"updateStructure",
"(",
")",
";",
"config",
".",
"setAutoOutlineNumber",
"(",
"false",
")",
";",
"//",
"// Perform post-processing to set the summary flag",
"//",
"for",
"(",
"Task",
"task",
":",
"m_project",
".",
"getTasks",
"(",
")",
")",
"{",
"task",
".",
"setSummary",
"(",
"task",
".",
"hasChildTasks",
"(",
")",
")",
";",
"}",
"//",
"// Ensure that the unique ID counters are correct",
"//",
"config",
".",
"updateUniqueCounters",
"(",
")",
";",
"}"
] |
Carry out any post-processing required to tidy up
the data read from the database.
|
[
"Carry",
"out",
"any",
"post",
"-",
"processing",
"required",
"to",
"tidy",
"up",
"the",
"data",
"read",
"from",
"the",
"database",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1236-L1261
|
156,719
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
|
MPD9AbstractReader.getNullOnValue
|
private Integer getNullOnValue(Integer value, int nullValue)
{
return (NumberHelper.getInt(value) == nullValue ? null : value);
}
|
java
|
private Integer getNullOnValue(Integer value, int nullValue)
{
return (NumberHelper.getInt(value) == nullValue ? null : value);
}
|
[
"private",
"Integer",
"getNullOnValue",
"(",
"Integer",
"value",
",",
"int",
"nullValue",
")",
"{",
"return",
"(",
"NumberHelper",
".",
"getInt",
"(",
"value",
")",
"==",
"nullValue",
"?",
"null",
":",
"value",
")",
";",
"}"
] |
This method returns the value it is passed, or null if the value
matches the nullValue argument.
@param value value under test
@param nullValue return null if value under test matches this value
@return value or null
|
[
"This",
"method",
"returns",
"the",
"value",
"it",
"is",
"passed",
"or",
"null",
"if",
"the",
"value",
"matches",
"the",
"nullValue",
"argument",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1283-L1286
|
156,720
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpp/ConstraintFactory.java
|
ConstraintFactory.process
|
public void process(DirectoryEntry projectDir, ProjectFile file, DocumentInputStreamFactory inputStreamFactory) throws IOException
{
DirectoryEntry consDir;
try
{
consDir = (DirectoryEntry) projectDir.getEntry("TBkndCons");
}
catch (FileNotFoundException ex)
{
consDir = null;
}
if (consDir != null)
{
FixedMeta consFixedMeta = new FixedMeta(new DocumentInputStream(((DocumentEntry) consDir.getEntry("FixedMeta"))), 10);
FixedData consFixedData = new FixedData(consFixedMeta, 20, inputStreamFactory.getInstance(consDir, "FixedData"));
// FixedMeta consFixed2Meta = new FixedMeta(new DocumentInputStream(((DocumentEntry) consDir.getEntry("Fixed2Meta"))), 9);
// FixedData consFixed2Data = new FixedData(consFixed2Meta, 48, getEncryptableInputStream(consDir, "Fixed2Data"));
int count = consFixedMeta.getAdjustedItemCount();
int lastConstraintID = -1;
ProjectProperties properties = file.getProjectProperties();
EventManager eventManager = file.getEventManager();
boolean project15 = NumberHelper.getInt(properties.getMppFileType()) == 14 && NumberHelper.getInt(properties.getApplicationVersion()) > ApplicationVersion.PROJECT_2010;
int durationUnitsOffset = project15 ? 18 : 14;
int durationOffset = project15 ? 14 : 16;
for (int loop = 0; loop < count; loop++)
{
byte[] metaData = consFixedMeta.getByteArrayValue(loop);
//
// SourceForge bug 2209477: we were reading an int here, but
// it looks like the deleted flag is just a short.
//
if (MPPUtility.getShort(metaData, 0) != 0)
{
continue;
}
int index = consFixedData.getIndexFromOffset(MPPUtility.getInt(metaData, 4));
if (index == -1)
{
continue;
}
//
// Do we have enough data?
//
byte[] data = consFixedData.getByteArrayValue(index);
if (data.length < 14)
{
continue;
}
int constraintID = MPPUtility.getInt(data, 0);
if (constraintID <= lastConstraintID)
{
continue;
}
lastConstraintID = constraintID;
int taskID1 = MPPUtility.getInt(data, 4);
int taskID2 = MPPUtility.getInt(data, 8);
if (taskID1 == taskID2)
{
continue;
}
// byte[] metaData2 = consFixed2Meta.getByteArrayValue(loop);
// int index2 = consFixed2Data.getIndexFromOffset(MPPUtility.getInt(metaData2, 4));
// byte[] data2 = consFixed2Data.getByteArrayValue(index2);
Task task1 = file.getTaskByUniqueID(Integer.valueOf(taskID1));
Task task2 = file.getTaskByUniqueID(Integer.valueOf(taskID2));
if (task1 != null && task2 != null)
{
RelationType type = RelationType.getInstance(MPPUtility.getShort(data, 12));
TimeUnit durationUnits = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, durationUnitsOffset));
Duration lag = MPPUtility.getAdjustedDuration(properties, MPPUtility.getInt(data, durationOffset), durationUnits);
Relation relation = task2.addPredecessor(task1, type, lag);
relation.setUniqueID(Integer.valueOf(constraintID));
eventManager.fireRelationReadEvent(relation);
}
}
}
}
|
java
|
public void process(DirectoryEntry projectDir, ProjectFile file, DocumentInputStreamFactory inputStreamFactory) throws IOException
{
DirectoryEntry consDir;
try
{
consDir = (DirectoryEntry) projectDir.getEntry("TBkndCons");
}
catch (FileNotFoundException ex)
{
consDir = null;
}
if (consDir != null)
{
FixedMeta consFixedMeta = new FixedMeta(new DocumentInputStream(((DocumentEntry) consDir.getEntry("FixedMeta"))), 10);
FixedData consFixedData = new FixedData(consFixedMeta, 20, inputStreamFactory.getInstance(consDir, "FixedData"));
// FixedMeta consFixed2Meta = new FixedMeta(new DocumentInputStream(((DocumentEntry) consDir.getEntry("Fixed2Meta"))), 9);
// FixedData consFixed2Data = new FixedData(consFixed2Meta, 48, getEncryptableInputStream(consDir, "Fixed2Data"));
int count = consFixedMeta.getAdjustedItemCount();
int lastConstraintID = -1;
ProjectProperties properties = file.getProjectProperties();
EventManager eventManager = file.getEventManager();
boolean project15 = NumberHelper.getInt(properties.getMppFileType()) == 14 && NumberHelper.getInt(properties.getApplicationVersion()) > ApplicationVersion.PROJECT_2010;
int durationUnitsOffset = project15 ? 18 : 14;
int durationOffset = project15 ? 14 : 16;
for (int loop = 0; loop < count; loop++)
{
byte[] metaData = consFixedMeta.getByteArrayValue(loop);
//
// SourceForge bug 2209477: we were reading an int here, but
// it looks like the deleted flag is just a short.
//
if (MPPUtility.getShort(metaData, 0) != 0)
{
continue;
}
int index = consFixedData.getIndexFromOffset(MPPUtility.getInt(metaData, 4));
if (index == -1)
{
continue;
}
//
// Do we have enough data?
//
byte[] data = consFixedData.getByteArrayValue(index);
if (data.length < 14)
{
continue;
}
int constraintID = MPPUtility.getInt(data, 0);
if (constraintID <= lastConstraintID)
{
continue;
}
lastConstraintID = constraintID;
int taskID1 = MPPUtility.getInt(data, 4);
int taskID2 = MPPUtility.getInt(data, 8);
if (taskID1 == taskID2)
{
continue;
}
// byte[] metaData2 = consFixed2Meta.getByteArrayValue(loop);
// int index2 = consFixed2Data.getIndexFromOffset(MPPUtility.getInt(metaData2, 4));
// byte[] data2 = consFixed2Data.getByteArrayValue(index2);
Task task1 = file.getTaskByUniqueID(Integer.valueOf(taskID1));
Task task2 = file.getTaskByUniqueID(Integer.valueOf(taskID2));
if (task1 != null && task2 != null)
{
RelationType type = RelationType.getInstance(MPPUtility.getShort(data, 12));
TimeUnit durationUnits = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, durationUnitsOffset));
Duration lag = MPPUtility.getAdjustedDuration(properties, MPPUtility.getInt(data, durationOffset), durationUnits);
Relation relation = task2.addPredecessor(task1, type, lag);
relation.setUniqueID(Integer.valueOf(constraintID));
eventManager.fireRelationReadEvent(relation);
}
}
}
}
|
[
"public",
"void",
"process",
"(",
"DirectoryEntry",
"projectDir",
",",
"ProjectFile",
"file",
",",
"DocumentInputStreamFactory",
"inputStreamFactory",
")",
"throws",
"IOException",
"{",
"DirectoryEntry",
"consDir",
";",
"try",
"{",
"consDir",
"=",
"(",
"DirectoryEntry",
")",
"projectDir",
".",
"getEntry",
"(",
"\"TBkndCons\"",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"ex",
")",
"{",
"consDir",
"=",
"null",
";",
"}",
"if",
"(",
"consDir",
"!=",
"null",
")",
"{",
"FixedMeta",
"consFixedMeta",
"=",
"new",
"FixedMeta",
"(",
"new",
"DocumentInputStream",
"(",
"(",
"(",
"DocumentEntry",
")",
"consDir",
".",
"getEntry",
"(",
"\"FixedMeta\"",
")",
")",
")",
",",
"10",
")",
";",
"FixedData",
"consFixedData",
"=",
"new",
"FixedData",
"(",
"consFixedMeta",
",",
"20",
",",
"inputStreamFactory",
".",
"getInstance",
"(",
"consDir",
",",
"\"FixedData\"",
")",
")",
";",
"// FixedMeta consFixed2Meta = new FixedMeta(new DocumentInputStream(((DocumentEntry) consDir.getEntry(\"Fixed2Meta\"))), 9);",
"// FixedData consFixed2Data = new FixedData(consFixed2Meta, 48, getEncryptableInputStream(consDir, \"Fixed2Data\"));",
"int",
"count",
"=",
"consFixedMeta",
".",
"getAdjustedItemCount",
"(",
")",
";",
"int",
"lastConstraintID",
"=",
"-",
"1",
";",
"ProjectProperties",
"properties",
"=",
"file",
".",
"getProjectProperties",
"(",
")",
";",
"EventManager",
"eventManager",
"=",
"file",
".",
"getEventManager",
"(",
")",
";",
"boolean",
"project15",
"=",
"NumberHelper",
".",
"getInt",
"(",
"properties",
".",
"getMppFileType",
"(",
")",
")",
"==",
"14",
"&&",
"NumberHelper",
".",
"getInt",
"(",
"properties",
".",
"getApplicationVersion",
"(",
")",
")",
">",
"ApplicationVersion",
".",
"PROJECT_2010",
";",
"int",
"durationUnitsOffset",
"=",
"project15",
"?",
"18",
":",
"14",
";",
"int",
"durationOffset",
"=",
"project15",
"?",
"14",
":",
"16",
";",
"for",
"(",
"int",
"loop",
"=",
"0",
";",
"loop",
"<",
"count",
";",
"loop",
"++",
")",
"{",
"byte",
"[",
"]",
"metaData",
"=",
"consFixedMeta",
".",
"getByteArrayValue",
"(",
"loop",
")",
";",
"//",
"// SourceForge bug 2209477: we were reading an int here, but",
"// it looks like the deleted flag is just a short.",
"//",
"if",
"(",
"MPPUtility",
".",
"getShort",
"(",
"metaData",
",",
"0",
")",
"!=",
"0",
")",
"{",
"continue",
";",
"}",
"int",
"index",
"=",
"consFixedData",
".",
"getIndexFromOffset",
"(",
"MPPUtility",
".",
"getInt",
"(",
"metaData",
",",
"4",
")",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"continue",
";",
"}",
"//",
"// Do we have enough data?",
"//",
"byte",
"[",
"]",
"data",
"=",
"consFixedData",
".",
"getByteArrayValue",
"(",
"index",
")",
";",
"if",
"(",
"data",
".",
"length",
"<",
"14",
")",
"{",
"continue",
";",
"}",
"int",
"constraintID",
"=",
"MPPUtility",
".",
"getInt",
"(",
"data",
",",
"0",
")",
";",
"if",
"(",
"constraintID",
"<=",
"lastConstraintID",
")",
"{",
"continue",
";",
"}",
"lastConstraintID",
"=",
"constraintID",
";",
"int",
"taskID1",
"=",
"MPPUtility",
".",
"getInt",
"(",
"data",
",",
"4",
")",
";",
"int",
"taskID2",
"=",
"MPPUtility",
".",
"getInt",
"(",
"data",
",",
"8",
")",
";",
"if",
"(",
"taskID1",
"==",
"taskID2",
")",
"{",
"continue",
";",
"}",
"// byte[] metaData2 = consFixed2Meta.getByteArrayValue(loop);",
"// int index2 = consFixed2Data.getIndexFromOffset(MPPUtility.getInt(metaData2, 4));",
"// byte[] data2 = consFixed2Data.getByteArrayValue(index2);",
"Task",
"task1",
"=",
"file",
".",
"getTaskByUniqueID",
"(",
"Integer",
".",
"valueOf",
"(",
"taskID1",
")",
")",
";",
"Task",
"task2",
"=",
"file",
".",
"getTaskByUniqueID",
"(",
"Integer",
".",
"valueOf",
"(",
"taskID2",
")",
")",
";",
"if",
"(",
"task1",
"!=",
"null",
"&&",
"task2",
"!=",
"null",
")",
"{",
"RelationType",
"type",
"=",
"RelationType",
".",
"getInstance",
"(",
"MPPUtility",
".",
"getShort",
"(",
"data",
",",
"12",
")",
")",
";",
"TimeUnit",
"durationUnits",
"=",
"MPPUtility",
".",
"getDurationTimeUnits",
"(",
"MPPUtility",
".",
"getShort",
"(",
"data",
",",
"durationUnitsOffset",
")",
")",
";",
"Duration",
"lag",
"=",
"MPPUtility",
".",
"getAdjustedDuration",
"(",
"properties",
",",
"MPPUtility",
".",
"getInt",
"(",
"data",
",",
"durationOffset",
")",
",",
"durationUnits",
")",
";",
"Relation",
"relation",
"=",
"task2",
".",
"addPredecessor",
"(",
"task1",
",",
"type",
",",
"lag",
")",
";",
"relation",
".",
"setUniqueID",
"(",
"Integer",
".",
"valueOf",
"(",
"constraintID",
")",
")",
";",
"eventManager",
".",
"fireRelationReadEvent",
"(",
"relation",
")",
";",
"}",
"}",
"}",
"}"
] |
Main entry point when called to process constraint data.
@param projectDir project directory
@param file parent project file
@param inputStreamFactory factory to create input stream
|
[
"Main",
"entry",
"point",
"when",
"called",
"to",
"process",
"constraint",
"data",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ConstraintFactory.java#L34-L124
|
156,721
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/TextFileRow.java
|
TextFileRow.getColumnValue
|
private Object getColumnValue(String table, String column, String data, int type, boolean epochDateFormat) throws MPXJException
{
try
{
Object value = null;
switch (type)
{
case Types.BIT:
{
value = DatatypeConverter.parseBoolean(data);
break;
}
case Types.VARCHAR:
case Types.LONGVARCHAR:
{
value = DatatypeConverter.parseString(data);
break;
}
case Types.TIME:
{
value = DatatypeConverter.parseBasicTime(data);
break;
}
case Types.TIMESTAMP:
{
if (epochDateFormat)
{
value = DatatypeConverter.parseEpochTimestamp(data);
}
else
{
value = DatatypeConverter.parseBasicTimestamp(data);
}
break;
}
case Types.DOUBLE:
{
value = DatatypeConverter.parseDouble(data);
break;
}
case Types.INTEGER:
{
value = DatatypeConverter.parseInteger(data);
break;
}
default:
{
throw new IllegalArgumentException("Unsupported SQL type: " + type);
}
}
return value;
}
catch (Exception ex)
{
throw new MPXJException("Failed to parse " + table + "." + column + " (data=" + data + ", type=" + type + ")", ex);
}
}
|
java
|
private Object getColumnValue(String table, String column, String data, int type, boolean epochDateFormat) throws MPXJException
{
try
{
Object value = null;
switch (type)
{
case Types.BIT:
{
value = DatatypeConverter.parseBoolean(data);
break;
}
case Types.VARCHAR:
case Types.LONGVARCHAR:
{
value = DatatypeConverter.parseString(data);
break;
}
case Types.TIME:
{
value = DatatypeConverter.parseBasicTime(data);
break;
}
case Types.TIMESTAMP:
{
if (epochDateFormat)
{
value = DatatypeConverter.parseEpochTimestamp(data);
}
else
{
value = DatatypeConverter.parseBasicTimestamp(data);
}
break;
}
case Types.DOUBLE:
{
value = DatatypeConverter.parseDouble(data);
break;
}
case Types.INTEGER:
{
value = DatatypeConverter.parseInteger(data);
break;
}
default:
{
throw new IllegalArgumentException("Unsupported SQL type: " + type);
}
}
return value;
}
catch (Exception ex)
{
throw new MPXJException("Failed to parse " + table + "." + column + " (data=" + data + ", type=" + type + ")", ex);
}
}
|
[
"private",
"Object",
"getColumnValue",
"(",
"String",
"table",
",",
"String",
"column",
",",
"String",
"data",
",",
"int",
"type",
",",
"boolean",
"epochDateFormat",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Object",
"value",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"Types",
".",
"BIT",
":",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseBoolean",
"(",
"data",
")",
";",
"break",
";",
"}",
"case",
"Types",
".",
"VARCHAR",
":",
"case",
"Types",
".",
"LONGVARCHAR",
":",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseString",
"(",
"data",
")",
";",
"break",
";",
"}",
"case",
"Types",
".",
"TIME",
":",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseBasicTime",
"(",
"data",
")",
";",
"break",
";",
"}",
"case",
"Types",
".",
"TIMESTAMP",
":",
"{",
"if",
"(",
"epochDateFormat",
")",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseEpochTimestamp",
"(",
"data",
")",
";",
"}",
"else",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseBasicTimestamp",
"(",
"data",
")",
";",
"}",
"break",
";",
"}",
"case",
"Types",
".",
"DOUBLE",
":",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseDouble",
"(",
"data",
")",
";",
"break",
";",
"}",
"case",
"Types",
".",
"INTEGER",
":",
"{",
"value",
"=",
"DatatypeConverter",
".",
"parseInteger",
"(",
"data",
")",
";",
"break",
";",
"}",
"default",
":",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unsupported SQL type: \"",
"+",
"type",
")",
";",
"}",
"}",
"return",
"value",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
"MPXJException",
"(",
"\"Failed to parse \"",
"+",
"table",
"+",
"\".\"",
"+",
"column",
"+",
"\" (data=\"",
"+",
"data",
"+",
"\", type=\"",
"+",
"type",
"+",
"\")\"",
",",
"ex",
")",
";",
"}",
"}"
] |
Maps the text representation of column data to Java types.
@param table table name
@param column column name
@param data text representation of column data
@param type column data type
@param epochDateFormat true if date is represented as an offset from an epoch
@return Java representation of column data
@throws MPXJException
|
[
"Maps",
"the",
"text",
"representation",
"of",
"column",
"data",
"to",
"Java",
"types",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/TextFileRow.java#L75-L140
|
156,722
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/conceptdraw/schema/Callouts.java
|
Callouts.getCallout
|
public List<Callouts.Callout> getCallout()
{
if (callout == null)
{
callout = new ArrayList<Callouts.Callout>();
}
return this.callout;
}
|
java
|
public List<Callouts.Callout> getCallout()
{
if (callout == null)
{
callout = new ArrayList<Callouts.Callout>();
}
return this.callout;
}
|
[
"public",
"List",
"<",
"Callouts",
".",
"Callout",
">",
"getCallout",
"(",
")",
"{",
"if",
"(",
"callout",
"==",
"null",
")",
"{",
"callout",
"=",
"new",
"ArrayList",
"<",
"Callouts",
".",
"Callout",
">",
"(",
")",
";",
"}",
"return",
"this",
".",
"callout",
";",
"}"
] |
Gets the value of the callout property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the callout property.
<p>
For example, to add a new item, do as follows:
<pre>
getCallout().add(newItem);
</pre>
<p>
Objects of the following type(s) are allowed in the list
{@link Callouts.Callout }
|
[
"Gets",
"the",
"value",
"of",
"the",
"callout",
"property",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/schema/Callouts.java#L83-L90
|
156,723
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java
|
DatatypeConverter.parseMinutesFromHours
|
public static final Integer parseMinutesFromHours(String value)
{
Integer result = null;
if (value != null)
{
result = Integer.valueOf(Integer.parseInt(value) * 60);
}
return result;
}
|
java
|
public static final Integer parseMinutesFromHours(String value)
{
Integer result = null;
if (value != null)
{
result = Integer.valueOf(Integer.parseInt(value) * 60);
}
return result;
}
|
[
"public",
"static",
"final",
"Integer",
"parseMinutesFromHours",
"(",
"String",
"value",
")",
"{",
"Integer",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"result",
"=",
"Integer",
".",
"valueOf",
"(",
"Integer",
".",
"parseInt",
"(",
"value",
")",
"*",
"60",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Parse a duration in minutes form a number of hours.
@param value String representation
@return Integer instance
|
[
"Parse",
"a",
"duration",
"in",
"minutes",
"form",
"a",
"number",
"of",
"hours",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java#L118-L126
|
156,724
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java
|
DatatypeConverter.parseCurrencySymbolPosition
|
public static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
{
CurrencySymbolPosition result = MAP_TO_CURRENCY_SYMBOL_POSITION.get(value);
result = result == null ? CurrencySymbolPosition.BEFORE_WITH_SPACE : result;
return result;
}
|
java
|
public static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
{
CurrencySymbolPosition result = MAP_TO_CURRENCY_SYMBOL_POSITION.get(value);
result = result == null ? CurrencySymbolPosition.BEFORE_WITH_SPACE : result;
return result;
}
|
[
"public",
"static",
"final",
"CurrencySymbolPosition",
"parseCurrencySymbolPosition",
"(",
"String",
"value",
")",
"{",
"CurrencySymbolPosition",
"result",
"=",
"MAP_TO_CURRENCY_SYMBOL_POSITION",
".",
"get",
"(",
"value",
")",
";",
"result",
"=",
"result",
"==",
"null",
"?",
"CurrencySymbolPosition",
".",
"BEFORE_WITH_SPACE",
":",
"result",
";",
"return",
"result",
";",
"}"
] |
Parse a currency symbol position from a string representation.
@param value String representation
@return CurrencySymbolPosition instance
|
[
"Parse",
"a",
"currency",
"symbol",
"position",
"from",
"a",
"string",
"representation",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java#L145-L150
|
156,725
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java
|
DatatypeConverter.parseDate
|
public static final Date parseDate(String value)
{
Date result = null;
try
{
if (value != null && !value.isEmpty())
{
result = DATE_FORMAT.get().parse(value);
}
}
catch (ParseException ex)
{
// Ignore
}
return result;
}
|
java
|
public static final Date parseDate(String value)
{
Date result = null;
try
{
if (value != null && !value.isEmpty())
{
result = DATE_FORMAT.get().parse(value);
}
}
catch (ParseException ex)
{
// Ignore
}
return result;
}
|
[
"public",
"static",
"final",
"Date",
"parseDate",
"(",
"String",
"value",
")",
"{",
"Date",
"result",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"result",
"=",
"DATE_FORMAT",
".",
"get",
"(",
")",
".",
"parse",
"(",
"value",
")",
";",
"}",
"}",
"catch",
"(",
"ParseException",
"ex",
")",
"{",
"// Ignore",
"}",
"return",
"result",
";",
"}"
] |
Parse a date value.
@param value String representation
@return Date instance
|
[
"Parse",
"a",
"date",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java#L227-L244
|
156,726
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java
|
DatatypeConverter.parseDateTime
|
public static final Date parseDateTime(String value)
{
Date result = null;
try
{
if (value != null && !value.isEmpty())
{
result = DATE_TIME_FORMAT.get().parse(value);
}
}
catch (ParseException ex)
{
// Ignore
}
return result;
}
|
java
|
public static final Date parseDateTime(String value)
{
Date result = null;
try
{
if (value != null && !value.isEmpty())
{
result = DATE_TIME_FORMAT.get().parse(value);
}
}
catch (ParseException ex)
{
// Ignore
}
return result;
}
|
[
"public",
"static",
"final",
"Date",
"parseDateTime",
"(",
"String",
"value",
")",
"{",
"Date",
"result",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"result",
"=",
"DATE_TIME_FORMAT",
".",
"get",
"(",
")",
".",
"parse",
"(",
"value",
")",
";",
"}",
"}",
"catch",
"(",
"ParseException",
"ex",
")",
"{",
"// Ignore",
"}",
"return",
"result",
";",
"}"
] |
Parse a date time value.
@param value String representation
@return Date instance
|
[
"Parse",
"a",
"date",
"time",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/DatatypeConverter.java#L263-L280
|
156,727
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/turboproject/PEPUtility.java
|
PEPUtility.getInt
|
public static final int getInt(byte[] data, int offset)
{
int result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 32; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
java
|
public static final int getInt(byte[] data, int offset)
{
int result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 32; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
[
"public",
"static",
"final",
"int",
"getInt",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"i",
"=",
"offset",
";",
"for",
"(",
"int",
"shiftBy",
"=",
"0",
";",
"shiftBy",
"<",
"32",
";",
"shiftBy",
"+=",
"8",
")",
"{",
"result",
"|=",
"(",
"(",
"data",
"[",
"i",
"]",
"&",
"0xff",
")",
")",
"<<",
"shiftBy",
";",
"++",
"i",
";",
"}",
"return",
"result",
";",
"}"
] |
Read a four byte integer.
@param data byte array
@param offset offset into array
@return integer value
|
[
"Read",
"a",
"four",
"byte",
"integer",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/PEPUtility.java#L42-L52
|
156,728
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/turboproject/PEPUtility.java
|
PEPUtility.getShort
|
public static final int getShort(byte[] data, int offset)
{
int result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 16; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
java
|
public static final int getShort(byte[] data, int offset)
{
int result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 16; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
[
"public",
"static",
"final",
"int",
"getShort",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"i",
"=",
"offset",
";",
"for",
"(",
"int",
"shiftBy",
"=",
"0",
";",
"shiftBy",
"<",
"16",
";",
"shiftBy",
"+=",
"8",
")",
"{",
"result",
"|=",
"(",
"(",
"data",
"[",
"i",
"]",
"&",
"0xff",
")",
")",
"<<",
"shiftBy",
";",
"++",
"i",
";",
"}",
"return",
"result",
";",
"}"
] |
Read a two byte integer.
@param data byte array
@param offset offset into array
@return integer value
|
[
"Read",
"a",
"two",
"byte",
"integer",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/PEPUtility.java#L61-L71
|
156,729
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/turboproject/PEPUtility.java
|
PEPUtility.getString
|
public static final String getString(byte[] data, int offset)
{
return getString(data, offset, data.length - offset);
}
|
java
|
public static final String getString(byte[] data, int offset)
{
return getString(data, offset, data.length - offset);
}
|
[
"public",
"static",
"final",
"String",
"getString",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"return",
"getString",
"(",
"data",
",",
"offset",
",",
"data",
".",
"length",
"-",
"offset",
")",
";",
"}"
] |
Retrieve a string value.
@param data byte array
@param offset offset into byte array
@return string value
|
[
"Retrieve",
"a",
"string",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/PEPUtility.java#L80-L83
|
156,730
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/turboproject/PEPUtility.java
|
PEPUtility.getFinishDate
|
public static final Date getFinishDate(byte[] data, int offset)
{
Date result;
long days = getShort(data, offset);
if (days == 0x8000)
{
result = null;
}
else
{
result = DateHelper.getDateFromLong(EPOCH + ((days - 1) * DateHelper.MS_PER_DAY));
}
return (result);
}
|
java
|
public static final Date getFinishDate(byte[] data, int offset)
{
Date result;
long days = getShort(data, offset);
if (days == 0x8000)
{
result = null;
}
else
{
result = DateHelper.getDateFromLong(EPOCH + ((days - 1) * DateHelper.MS_PER_DAY));
}
return (result);
}
|
[
"public",
"static",
"final",
"Date",
"getFinishDate",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Date",
"result",
";",
"long",
"days",
"=",
"getShort",
"(",
"data",
",",
"offset",
")",
";",
"if",
"(",
"days",
"==",
"0x8000",
")",
"{",
"result",
"=",
"null",
";",
"}",
"else",
"{",
"result",
"=",
"DateHelper",
".",
"getDateFromLong",
"(",
"EPOCH",
"+",
"(",
"(",
"days",
"-",
"1",
")",
"*",
"DateHelper",
".",
"MS_PER_DAY",
")",
")",
";",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Retrieve a finish date.
@param data byte array
@param offset offset into byte array
@return finish date
|
[
"Retrieve",
"a",
"finish",
"date",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/PEPUtility.java#L144-L159
|
156,731
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.setDefaultCalendarName
|
public void setDefaultCalendarName(String calendarName)
{
if (calendarName == null || calendarName.length() == 0)
{
calendarName = DEFAULT_CALENDAR_NAME;
}
set(ProjectField.DEFAULT_CALENDAR_NAME, calendarName);
}
|
java
|
public void setDefaultCalendarName(String calendarName)
{
if (calendarName == null || calendarName.length() == 0)
{
calendarName = DEFAULT_CALENDAR_NAME;
}
set(ProjectField.DEFAULT_CALENDAR_NAME, calendarName);
}
|
[
"public",
"void",
"setDefaultCalendarName",
"(",
"String",
"calendarName",
")",
"{",
"if",
"(",
"calendarName",
"==",
"null",
"||",
"calendarName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"calendarName",
"=",
"DEFAULT_CALENDAR_NAME",
";",
"}",
"set",
"(",
"ProjectField",
".",
"DEFAULT_CALENDAR_NAME",
",",
"calendarName",
")",
";",
"}"
] |
Sets the Calendar used. 'Standard' if no value is set.
@param calendarName Calendar name
|
[
"Sets",
"the",
"Calendar",
"used",
".",
"Standard",
"if",
"no",
"value",
"is",
"set",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L566-L574
|
156,732
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getStartDate
|
public Date getStartDate()
{
Date result = (Date) getCachedValue(ProjectField.START_DATE);
if (result == null)
{
result = getParentFile().getStartDate();
}
return (result);
}
|
java
|
public Date getStartDate()
{
Date result = (Date) getCachedValue(ProjectField.START_DATE);
if (result == null)
{
result = getParentFile().getStartDate();
}
return (result);
}
|
[
"public",
"Date",
"getStartDate",
"(",
")",
"{",
"Date",
"result",
"=",
"(",
"Date",
")",
"getCachedValue",
"(",
"ProjectField",
".",
"START_DATE",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"getParentFile",
"(",
")",
".",
"getStartDate",
"(",
")",
";",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Retrieves the project start date. If an explicit start date has not been
set, this method calculates the start date by looking for
the earliest task start date.
@return project start date
|
[
"Retrieves",
"the",
"project",
"start",
"date",
".",
"If",
"an",
"explicit",
"start",
"date",
"has",
"not",
"been",
"set",
"this",
"method",
"calculates",
"the",
"start",
"date",
"by",
"looking",
"for",
"the",
"earliest",
"task",
"start",
"date",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L603-L611
|
156,733
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getFinishDate
|
public Date getFinishDate()
{
Date result = (Date) getCachedValue(ProjectField.FINISH_DATE);
if (result == null)
{
result = getParentFile().getFinishDate();
}
return (result);
}
|
java
|
public Date getFinishDate()
{
Date result = (Date) getCachedValue(ProjectField.FINISH_DATE);
if (result == null)
{
result = getParentFile().getFinishDate();
}
return (result);
}
|
[
"public",
"Date",
"getFinishDate",
"(",
")",
"{",
"Date",
"result",
"=",
"(",
"Date",
")",
"getCachedValue",
"(",
"ProjectField",
".",
"FINISH_DATE",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"getParentFile",
"(",
")",
".",
"getFinishDate",
"(",
")",
";",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Retrieves the project finish date. If an explicit finish date has not been
set, this method calculates the finish date by looking for
the latest task finish date.
@return Finish Date
|
[
"Retrieves",
"the",
"project",
"finish",
"date",
".",
"If",
"an",
"explicit",
"finish",
"date",
"has",
"not",
"been",
"set",
"this",
"method",
"calculates",
"the",
"finish",
"date",
"by",
"looking",
"for",
"the",
"latest",
"task",
"finish",
"date",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L620-L628
|
156,734
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.setCurrencySymbol
|
public void setCurrencySymbol(String symbol)
{
if (symbol == null)
{
symbol = DEFAULT_CURRENCY_SYMBOL;
}
set(ProjectField.CURRENCY_SYMBOL, symbol);
}
|
java
|
public void setCurrencySymbol(String symbol)
{
if (symbol == null)
{
symbol = DEFAULT_CURRENCY_SYMBOL;
}
set(ProjectField.CURRENCY_SYMBOL, symbol);
}
|
[
"public",
"void",
"setCurrencySymbol",
"(",
"String",
"symbol",
")",
"{",
"if",
"(",
"symbol",
"==",
"null",
")",
"{",
"symbol",
"=",
"DEFAULT_CURRENCY_SYMBOL",
";",
"}",
"set",
"(",
"ProjectField",
".",
"CURRENCY_SYMBOL",
",",
"symbol",
")",
";",
"}"
] |
Sets currency symbol.
@param symbol currency symbol
|
[
"Sets",
"currency",
"symbol",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L1107-L1115
|
156,735
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.setSymbolPosition
|
public void setSymbolPosition(CurrencySymbolPosition posn)
{
if (posn == null)
{
posn = DEFAULT_CURRENCY_SYMBOL_POSITION;
}
set(ProjectField.CURRENCY_SYMBOL_POSITION, posn);
}
|
java
|
public void setSymbolPosition(CurrencySymbolPosition posn)
{
if (posn == null)
{
posn = DEFAULT_CURRENCY_SYMBOL_POSITION;
}
set(ProjectField.CURRENCY_SYMBOL_POSITION, posn);
}
|
[
"public",
"void",
"setSymbolPosition",
"(",
"CurrencySymbolPosition",
"posn",
")",
"{",
"if",
"(",
"posn",
"==",
"null",
")",
"{",
"posn",
"=",
"DEFAULT_CURRENCY_SYMBOL_POSITION",
";",
"}",
"set",
"(",
"ProjectField",
".",
"CURRENCY_SYMBOL_POSITION",
",",
"posn",
")",
";",
"}"
] |
Sets the position of the currency symbol.
@param posn currency symbol position.
|
[
"Sets",
"the",
"position",
"of",
"the",
"currency",
"symbol",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L1132-L1139
|
156,736
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.setCurrencyDigits
|
public void setCurrencyDigits(Integer currDigs)
{
if (currDigs == null)
{
currDigs = DEFAULT_CURRENCY_DIGITS;
}
set(ProjectField.CURRENCY_DIGITS, currDigs);
}
|
java
|
public void setCurrencyDigits(Integer currDigs)
{
if (currDigs == null)
{
currDigs = DEFAULT_CURRENCY_DIGITS;
}
set(ProjectField.CURRENCY_DIGITS, currDigs);
}
|
[
"public",
"void",
"setCurrencyDigits",
"(",
"Integer",
"currDigs",
")",
"{",
"if",
"(",
"currDigs",
"==",
"null",
")",
"{",
"currDigs",
"=",
"DEFAULT_CURRENCY_DIGITS",
";",
"}",
"set",
"(",
"ProjectField",
".",
"CURRENCY_DIGITS",
",",
"currDigs",
")",
";",
"}"
] |
Sets no of currency digits.
@param currDigs Available values, 0,1,2
|
[
"Sets",
"no",
"of",
"currency",
"digits",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L1156-L1163
|
156,737
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getMinutesPerMonth
|
public Number getMinutesPerMonth()
{
return Integer.valueOf(NumberHelper.getInt(getMinutesPerDay()) * NumberHelper.getInt(getDaysPerMonth()));
}
|
java
|
public Number getMinutesPerMonth()
{
return Integer.valueOf(NumberHelper.getInt(getMinutesPerDay()) * NumberHelper.getInt(getDaysPerMonth()));
}
|
[
"public",
"Number",
"getMinutesPerMonth",
"(",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"NumberHelper",
".",
"getInt",
"(",
"getMinutesPerDay",
"(",
")",
")",
"*",
"NumberHelper",
".",
"getInt",
"(",
"getDaysPerMonth",
"(",
")",
")",
")",
";",
"}"
] |
Retrieve the default number of minutes per month.
@return minutes per month
|
[
"Retrieve",
"the",
"default",
"number",
"of",
"minutes",
"per",
"month",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L1337-L1340
|
156,738
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getMinutesPerYear
|
public Number getMinutesPerYear()
{
return Integer.valueOf(NumberHelper.getInt(getMinutesPerDay()) * NumberHelper.getInt(getDaysPerMonth()) * 12);
}
|
java
|
public Number getMinutesPerYear()
{
return Integer.valueOf(NumberHelper.getInt(getMinutesPerDay()) * NumberHelper.getInt(getDaysPerMonth()) * 12);
}
|
[
"public",
"Number",
"getMinutesPerYear",
"(",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"NumberHelper",
".",
"getInt",
"(",
"getMinutesPerDay",
"(",
")",
")",
"*",
"NumberHelper",
".",
"getInt",
"(",
"getDaysPerMonth",
"(",
")",
")",
"*",
"12",
")",
";",
"}"
] |
Retrieve the default number of minutes per year.
@return minutes per year
|
[
"Retrieve",
"the",
"default",
"number",
"of",
"minutes",
"per",
"year",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L1347-L1350
|
156,739
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getCustomProperties
|
@SuppressWarnings("unchecked") public Map<String, Object> getCustomProperties()
{
return (Map<String, Object>) getCachedValue(ProjectField.CUSTOM_PROPERTIES);
}
|
java
|
@SuppressWarnings("unchecked") public Map<String, Object> getCustomProperties()
{
return (Map<String, Object>) getCachedValue(ProjectField.CUSTOM_PROPERTIES);
}
|
[
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getCustomProperties",
"(",
")",
"{",
"return",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"getCachedValue",
"(",
"ProjectField",
".",
"CUSTOM_PROPERTIES",
")",
";",
"}"
] |
Retrieve a map of custom document properties.
@return the Document Summary Information Map
|
[
"Retrieve",
"a",
"map",
"of",
"custom",
"document",
"properties",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L2111-L2114
|
156,740
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.getCachedCharValue
|
private char getCachedCharValue(FieldType field, char defaultValue)
{
Character c = (Character) getCachedValue(field);
return c == null ? defaultValue : c.charValue();
}
|
java
|
private char getCachedCharValue(FieldType field, char defaultValue)
{
Character c = (Character) getCachedValue(field);
return c == null ? defaultValue : c.charValue();
}
|
[
"private",
"char",
"getCachedCharValue",
"(",
"FieldType",
"field",
",",
"char",
"defaultValue",
")",
"{",
"Character",
"c",
"=",
"(",
"Character",
")",
"getCachedValue",
"(",
"field",
")",
";",
"return",
"c",
"==",
"null",
"?",
"defaultValue",
":",
"c",
".",
"charValue",
"(",
")",
";",
"}"
] |
Handles retrieval of primitive char type.
@param field required field
@param defaultValue default value if field is missing
@return char value
|
[
"Handles",
"retrieval",
"of",
"primitive",
"char",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L2690-L2694
|
156,741
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ProjectProperties.java
|
ProjectProperties.set
|
private void set(FieldType field, boolean value)
{
set(field, (value ? Boolean.TRUE : Boolean.FALSE));
}
|
java
|
private void set(FieldType field, boolean value)
{
set(field, (value ? Boolean.TRUE : Boolean.FALSE));
}
|
[
"private",
"void",
"set",
"(",
"FieldType",
"field",
",",
"boolean",
"value",
")",
"{",
"set",
"(",
"field",
",",
"(",
"value",
"?",
"Boolean",
".",
"TRUE",
":",
"Boolean",
".",
"FALSE",
")",
")",
";",
"}"
] |
This method inserts a name value pair into internal storage.
@param field task field
@param value attribute value
|
[
"This",
"method",
"inserts",
"a",
"name",
"value",
"pair",
"into",
"internal",
"storage",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L2730-L2733
|
156,742
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java
|
AstaDatabaseReader.getRows
|
private List<Row> getRows(String sql) throws SQLException
{
allocateConnection();
try
{
List<Row> result = new LinkedList<Row>();
m_ps = m_connection.prepareStatement(sql);
m_rs = m_ps.executeQuery();
populateMetaData();
while (m_rs.next())
{
result.add(new MpdResultSetRow(m_rs, m_meta));
}
return (result);
}
finally
{
releaseConnection();
}
}
|
java
|
private List<Row> getRows(String sql) throws SQLException
{
allocateConnection();
try
{
List<Row> result = new LinkedList<Row>();
m_ps = m_connection.prepareStatement(sql);
m_rs = m_ps.executeQuery();
populateMetaData();
while (m_rs.next())
{
result.add(new MpdResultSetRow(m_rs, m_meta));
}
return (result);
}
finally
{
releaseConnection();
}
}
|
[
"private",
"List",
"<",
"Row",
">",
"getRows",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"allocateConnection",
"(",
")",
";",
"try",
"{",
"List",
"<",
"Row",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"Row",
">",
"(",
")",
";",
"m_ps",
"=",
"m_connection",
".",
"prepareStatement",
"(",
"sql",
")",
";",
"m_rs",
"=",
"m_ps",
".",
"executeQuery",
"(",
")",
";",
"populateMetaData",
"(",
")",
";",
"while",
"(",
"m_rs",
".",
"next",
"(",
")",
")",
"{",
"result",
".",
"add",
"(",
"new",
"MpdResultSetRow",
"(",
"m_rs",
",",
"m_meta",
")",
")",
";",
"}",
"return",
"(",
"result",
")",
";",
"}",
"finally",
"{",
"releaseConnection",
"(",
")",
";",
"}",
"}"
] |
Retrieve a number of rows matching the supplied query.
@param sql query statement
@return result set
@throws SQLException
|
[
"Retrieve",
"a",
"number",
"of",
"rows",
"matching",
"the",
"supplied",
"query",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java#L362-L385
|
156,743
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java
|
AstaDatabaseReader.releaseConnection
|
private void releaseConnection()
{
if (m_rs != null)
{
try
{
m_rs.close();
}
catch (SQLException ex)
{
// silently ignore errors on close
}
m_rs = null;
}
if (m_ps != null)
{
try
{
m_ps.close();
}
catch (SQLException ex)
{
// silently ignore errors on close
}
m_ps = null;
}
}
|
java
|
private void releaseConnection()
{
if (m_rs != null)
{
try
{
m_rs.close();
}
catch (SQLException ex)
{
// silently ignore errors on close
}
m_rs = null;
}
if (m_ps != null)
{
try
{
m_ps.close();
}
catch (SQLException ex)
{
// silently ignore errors on close
}
m_ps = null;
}
}
|
[
"private",
"void",
"releaseConnection",
"(",
")",
"{",
"if",
"(",
"m_rs",
"!=",
"null",
")",
"{",
"try",
"{",
"m_rs",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"ex",
")",
"{",
"// silently ignore errors on close",
"}",
"m_rs",
"=",
"null",
";",
"}",
"if",
"(",
"m_ps",
"!=",
"null",
")",
"{",
"try",
"{",
"m_ps",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"SQLException",
"ex",
")",
"{",
"// silently ignore errors on close",
"}",
"m_ps",
"=",
"null",
";",
"}",
"}"
] |
Releases a database connection, and cleans up any resources
associated with that connection.
|
[
"Releases",
"a",
"database",
"connection",
"and",
"cleans",
"up",
"any",
"resources",
"associated",
"with",
"that",
"connection",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java#L440-L471
|
156,744
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java
|
AstaDatabaseReader.populateMetaData
|
private void populateMetaData() throws SQLException
{
m_meta.clear();
ResultSetMetaData meta = m_rs.getMetaData();
int columnCount = meta.getColumnCount() + 1;
for (int loop = 1; loop < columnCount; loop++)
{
String name = meta.getColumnName(loop);
Integer type = Integer.valueOf(meta.getColumnType(loop));
m_meta.put(name, type);
}
}
|
java
|
private void populateMetaData() throws SQLException
{
m_meta.clear();
ResultSetMetaData meta = m_rs.getMetaData();
int columnCount = meta.getColumnCount() + 1;
for (int loop = 1; loop < columnCount; loop++)
{
String name = meta.getColumnName(loop);
Integer type = Integer.valueOf(meta.getColumnType(loop));
m_meta.put(name, type);
}
}
|
[
"private",
"void",
"populateMetaData",
"(",
")",
"throws",
"SQLException",
"{",
"m_meta",
".",
"clear",
"(",
")",
";",
"ResultSetMetaData",
"meta",
"=",
"m_rs",
".",
"getMetaData",
"(",
")",
";",
"int",
"columnCount",
"=",
"meta",
".",
"getColumnCount",
"(",
")",
"+",
"1",
";",
"for",
"(",
"int",
"loop",
"=",
"1",
";",
"loop",
"<",
"columnCount",
";",
"loop",
"++",
")",
"{",
"String",
"name",
"=",
"meta",
".",
"getColumnName",
"(",
"loop",
")",
";",
"Integer",
"type",
"=",
"Integer",
".",
"valueOf",
"(",
"meta",
".",
"getColumnType",
"(",
"loop",
")",
")",
";",
"m_meta",
".",
"put",
"(",
"name",
",",
"type",
")",
";",
"}",
"}"
] |
Retrieves basic meta data from the result set.
@throws SQLException
|
[
"Retrieves",
"basic",
"meta",
"data",
"from",
"the",
"result",
"set",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java#L478-L490
|
156,745
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java
|
AstaDatabaseReader.setSchema
|
public void setSchema(String schema)
{
if (schema.charAt(schema.length() - 1) != '.')
{
schema = schema + '.';
}
m_schema = schema;
}
|
java
|
public void setSchema(String schema)
{
if (schema.charAt(schema.length() - 1) != '.')
{
schema = schema + '.';
}
m_schema = schema;
}
|
[
"public",
"void",
"setSchema",
"(",
"String",
"schema",
")",
"{",
"if",
"(",
"schema",
".",
"charAt",
"(",
"schema",
".",
"length",
"(",
")",
"-",
"1",
")",
"!=",
"'",
"'",
")",
"{",
"schema",
"=",
"schema",
"+",
"'",
"'",
";",
"}",
"m_schema",
"=",
"schema",
";",
"}"
] |
Set the name of the schema containing the schedule tables.
@param schema schema name.
|
[
"Set",
"the",
"name",
"of",
"the",
"schema",
"containing",
"the",
"schedule",
"tables",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaDatabaseReader.java#L497-L504
|
156,746
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/ActivityCode.java
|
ActivityCode.addValue
|
public ActivityCodeValue addValue(Integer uniqueID, String name, String description)
{
ActivityCodeValue value = new ActivityCodeValue(this, uniqueID, name, description);
m_values.add(value);
return value;
}
|
java
|
public ActivityCodeValue addValue(Integer uniqueID, String name, String description)
{
ActivityCodeValue value = new ActivityCodeValue(this, uniqueID, name, description);
m_values.add(value);
return value;
}
|
[
"public",
"ActivityCodeValue",
"addValue",
"(",
"Integer",
"uniqueID",
",",
"String",
"name",
",",
"String",
"description",
")",
"{",
"ActivityCodeValue",
"value",
"=",
"new",
"ActivityCodeValue",
"(",
"this",
",",
"uniqueID",
",",
"name",
",",
"description",
")",
";",
"m_values",
".",
"add",
"(",
"value",
")",
";",
"return",
"value",
";",
"}"
] |
Add a value to this activity code.
@param uniqueID value unique ID
@param name value name
@param description value description
@return ActivityCodeValue instance
|
[
"Add",
"a",
"value",
"to",
"this",
"activity",
"code",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ActivityCode.java#L75-L80
|
156,747
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getLong
|
public static final long getLong(byte[] data, int offset)
{
long result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 64; shiftBy += 8)
{
result |= ((long) (data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
java
|
public static final long getLong(byte[] data, int offset)
{
long result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 64; shiftBy += 8)
{
result |= ((long) (data[i] & 0xff)) << shiftBy;
++i;
}
return result;
}
|
[
"public",
"static",
"final",
"long",
"getLong",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"long",
"result",
"=",
"0",
";",
"int",
"i",
"=",
"offset",
";",
"for",
"(",
"int",
"shiftBy",
"=",
"0",
";",
"shiftBy",
"<",
"64",
";",
"shiftBy",
"+=",
"8",
")",
"{",
"result",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"i",
"]",
"&",
"0xff",
")",
")",
"<<",
"shiftBy",
";",
"++",
"i",
";",
"}",
"return",
"result",
";",
"}"
] |
Read a long int from a byte array.
@param data byte array
@param offset start offset
@return long value
|
[
"Read",
"a",
"long",
"int",
"from",
"a",
"byte",
"array",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L114-L124
|
156,748
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getInt
|
public static final int getInt(InputStream is) throws IOException
{
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
}
|
java
|
public static final int getInt(InputStream is) throws IOException
{
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
}
|
[
"public",
"static",
"final",
"int",
"getInt",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"return",
"getInt",
"(",
"data",
",",
"0",
")",
";",
"}"
] |
Read an int from an input stream.
@param is input stream
@return int value
|
[
"Read",
"an",
"int",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L132-L137
|
156,749
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getShort
|
public static final int getShort(InputStream is) throws IOException
{
byte[] data = new byte[2];
is.read(data);
return getShort(data, 0);
}
|
java
|
public static final int getShort(InputStream is) throws IOException
{
byte[] data = new byte[2];
is.read(data);
return getShort(data, 0);
}
|
[
"public",
"static",
"final",
"int",
"getShort",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"2",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"return",
"getShort",
"(",
"data",
",",
"0",
")",
";",
"}"
] |
Read a short int from an input stream.
@param is input stream
@return int value
|
[
"Read",
"a",
"short",
"int",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L156-L161
|
156,750
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getLong
|
public static final long getLong(InputStream is) throws IOException
{
byte[] data = new byte[8];
is.read(data);
return getLong(data, 0);
}
|
java
|
public static final long getLong(InputStream is) throws IOException
{
byte[] data = new byte[8];
is.read(data);
return getLong(data, 0);
}
|
[
"public",
"static",
"final",
"long",
"getLong",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"8",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"return",
"getLong",
"(",
"data",
",",
"0",
")",
";",
"}"
] |
Read a long int from an input stream.
@param is input stream
@return long value
|
[
"Read",
"a",
"long",
"int",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L169-L174
|
156,751
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getString
|
public static final String getString(InputStream is) throws IOException
{
int type = is.read();
if (type != 1)
{
throw new IllegalArgumentException("Unexpected string format");
}
Charset charset = CharsetHelper.UTF8;
int length = is.read();
if (length == 0xFF)
{
length = getShort(is);
if (length == 0xFFFE)
{
charset = CharsetHelper.UTF16LE;
length = (is.read() * 2);
}
}
String result;
if (length == 0)
{
result = null;
}
else
{
byte[] stringData = new byte[length];
is.read(stringData);
result = new String(stringData, charset);
}
return result;
}
|
java
|
public static final String getString(InputStream is) throws IOException
{
int type = is.read();
if (type != 1)
{
throw new IllegalArgumentException("Unexpected string format");
}
Charset charset = CharsetHelper.UTF8;
int length = is.read();
if (length == 0xFF)
{
length = getShort(is);
if (length == 0xFFFE)
{
charset = CharsetHelper.UTF16LE;
length = (is.read() * 2);
}
}
String result;
if (length == 0)
{
result = null;
}
else
{
byte[] stringData = new byte[length];
is.read(stringData);
result = new String(stringData, charset);
}
return result;
}
|
[
"public",
"static",
"final",
"String",
"getString",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"int",
"type",
"=",
"is",
".",
"read",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unexpected string format\"",
")",
";",
"}",
"Charset",
"charset",
"=",
"CharsetHelper",
".",
"UTF8",
";",
"int",
"length",
"=",
"is",
".",
"read",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0xFF",
")",
"{",
"length",
"=",
"getShort",
"(",
"is",
")",
";",
"if",
"(",
"length",
"==",
"0xFFFE",
")",
"{",
"charset",
"=",
"CharsetHelper",
".",
"UTF16LE",
";",
"length",
"=",
"(",
"is",
".",
"read",
"(",
")",
"*",
"2",
")",
";",
"}",
"}",
"String",
"result",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"result",
"=",
"null",
";",
"}",
"else",
"{",
"byte",
"[",
"]",
"stringData",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"is",
".",
"read",
"(",
"stringData",
")",
";",
"result",
"=",
"new",
"String",
"(",
"stringData",
",",
"charset",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Read a Synchro string from an input stream.
@param is input stream
@return String instance
|
[
"Read",
"a",
"Synchro",
"string",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L182-L215
|
156,752
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getUUID
|
public static final UUID getUUID(InputStream is) throws IOException
{
byte[] data = new byte[16];
is.read(data);
long long1 = 0;
long1 |= ((long) (data[3] & 0xFF)) << 56;
long1 |= ((long) (data[2] & 0xFF)) << 48;
long1 |= ((long) (data[1] & 0xFF)) << 40;
long1 |= ((long) (data[0] & 0xFF)) << 32;
long1 |= ((long) (data[5] & 0xFF)) << 24;
long1 |= ((long) (data[4] & 0xFF)) << 16;
long1 |= ((long) (data[7] & 0xFF)) << 8;
long1 |= ((long) (data[6] & 0xFF)) << 0;
long long2 = 0;
long2 |= ((long) (data[8] & 0xFF)) << 56;
long2 |= ((long) (data[9] & 0xFF)) << 48;
long2 |= ((long) (data[10] & 0xFF)) << 40;
long2 |= ((long) (data[11] & 0xFF)) << 32;
long2 |= ((long) (data[12] & 0xFF)) << 24;
long2 |= ((long) (data[13] & 0xFF)) << 16;
long2 |= ((long) (data[14] & 0xFF)) << 8;
long2 |= ((long) (data[15] & 0xFF)) << 0;
return new UUID(long1, long2);
}
|
java
|
public static final UUID getUUID(InputStream is) throws IOException
{
byte[] data = new byte[16];
is.read(data);
long long1 = 0;
long1 |= ((long) (data[3] & 0xFF)) << 56;
long1 |= ((long) (data[2] & 0xFF)) << 48;
long1 |= ((long) (data[1] & 0xFF)) << 40;
long1 |= ((long) (data[0] & 0xFF)) << 32;
long1 |= ((long) (data[5] & 0xFF)) << 24;
long1 |= ((long) (data[4] & 0xFF)) << 16;
long1 |= ((long) (data[7] & 0xFF)) << 8;
long1 |= ((long) (data[6] & 0xFF)) << 0;
long long2 = 0;
long2 |= ((long) (data[8] & 0xFF)) << 56;
long2 |= ((long) (data[9] & 0xFF)) << 48;
long2 |= ((long) (data[10] & 0xFF)) << 40;
long2 |= ((long) (data[11] & 0xFF)) << 32;
long2 |= ((long) (data[12] & 0xFF)) << 24;
long2 |= ((long) (data[13] & 0xFF)) << 16;
long2 |= ((long) (data[14] & 0xFF)) << 8;
long2 |= ((long) (data[15] & 0xFF)) << 0;
return new UUID(long1, long2);
}
|
[
"public",
"static",
"final",
"UUID",
"getUUID",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"16",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"long",
"long1",
"=",
"0",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"3",
"]",
"&",
"0xFF",
")",
")",
"<<",
"56",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"2",
"]",
"&",
"0xFF",
")",
")",
"<<",
"48",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"1",
"]",
"&",
"0xFF",
")",
")",
"<<",
"40",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"0",
"]",
"&",
"0xFF",
")",
")",
"<<",
"32",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"5",
"]",
"&",
"0xFF",
")",
")",
"<<",
"24",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"4",
"]",
"&",
"0xFF",
")",
")",
"<<",
"16",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"7",
"]",
"&",
"0xFF",
")",
")",
"<<",
"8",
";",
"long1",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"6",
"]",
"&",
"0xFF",
")",
")",
"<<",
"0",
";",
"long",
"long2",
"=",
"0",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"8",
"]",
"&",
"0xFF",
")",
")",
"<<",
"56",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"9",
"]",
"&",
"0xFF",
")",
")",
"<<",
"48",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"10",
"]",
"&",
"0xFF",
")",
")",
"<<",
"40",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"11",
"]",
"&",
"0xFF",
")",
")",
"<<",
"32",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"12",
"]",
"&",
"0xFF",
")",
")",
"<<",
"24",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"13",
"]",
"&",
"0xFF",
")",
")",
"<<",
"16",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"14",
"]",
"&",
"0xFF",
")",
")",
"<<",
"8",
";",
"long2",
"|=",
"(",
"(",
"long",
")",
"(",
"data",
"[",
"15",
"]",
"&",
"0xFF",
")",
")",
"<<",
"0",
";",
"return",
"new",
"UUID",
"(",
"long1",
",",
"long2",
")",
";",
"}"
] |
Retrieve a UUID from an input stream.
@param is input stream
@return UUID instance
|
[
"Retrieve",
"a",
"UUID",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L235-L261
|
156,753
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getDate
|
public static final Date getDate(InputStream is) throws IOException
{
long timeInSeconds = getInt(is);
if (timeInSeconds == 0x93406FFF)
{
return null;
}
timeInSeconds -= 3600;
timeInSeconds *= 1000;
return DateHelper.getDateFromLong(timeInSeconds);
}
|
java
|
public static final Date getDate(InputStream is) throws IOException
{
long timeInSeconds = getInt(is);
if (timeInSeconds == 0x93406FFF)
{
return null;
}
timeInSeconds -= 3600;
timeInSeconds *= 1000;
return DateHelper.getDateFromLong(timeInSeconds);
}
|
[
"public",
"static",
"final",
"Date",
"getDate",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"long",
"timeInSeconds",
"=",
"getInt",
"(",
"is",
")",
";",
"if",
"(",
"timeInSeconds",
"==",
"0x93406FFF",
")",
"{",
"return",
"null",
";",
"}",
"timeInSeconds",
"-=",
"3600",
";",
"timeInSeconds",
"*=",
"1000",
";",
"return",
"DateHelper",
".",
"getDateFromLong",
"(",
"timeInSeconds",
")",
";",
"}"
] |
Read a Synchro date from an input stream.
@param is input stream
@return Date instance
|
[
"Read",
"a",
"Synchro",
"date",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L269-L279
|
156,754
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getTime
|
public static final Date getTime(InputStream is) throws IOException
{
int timeValue = getInt(is);
timeValue -= 86400;
timeValue /= 60;
return DateHelper.getTimeFromMinutesPastMidnight(Integer.valueOf(timeValue));
}
|
java
|
public static final Date getTime(InputStream is) throws IOException
{
int timeValue = getInt(is);
timeValue -= 86400;
timeValue /= 60;
return DateHelper.getTimeFromMinutesPastMidnight(Integer.valueOf(timeValue));
}
|
[
"public",
"static",
"final",
"Date",
"getTime",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"int",
"timeValue",
"=",
"getInt",
"(",
"is",
")",
";",
"timeValue",
"-=",
"86400",
";",
"timeValue",
"/=",
"60",
";",
"return",
"DateHelper",
".",
"getTimeFromMinutesPastMidnight",
"(",
"Integer",
".",
"valueOf",
"(",
"timeValue",
")",
")",
";",
"}"
] |
Read a Synchro time from an input stream.
@param is input stream
@return Date instance
|
[
"Read",
"a",
"Synchro",
"time",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L287-L293
|
156,755
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getDuration
|
public static final Duration getDuration(InputStream is) throws IOException
{
double durationInSeconds = getInt(is);
durationInSeconds /= (60 * 60);
return Duration.getInstance(durationInSeconds, TimeUnit.HOURS);
}
|
java
|
public static final Duration getDuration(InputStream is) throws IOException
{
double durationInSeconds = getInt(is);
durationInSeconds /= (60 * 60);
return Duration.getInstance(durationInSeconds, TimeUnit.HOURS);
}
|
[
"public",
"static",
"final",
"Duration",
"getDuration",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"double",
"durationInSeconds",
"=",
"getInt",
"(",
"is",
")",
";",
"durationInSeconds",
"/=",
"(",
"60",
"*",
"60",
")",
";",
"return",
"Duration",
".",
"getInstance",
"(",
"durationInSeconds",
",",
"TimeUnit",
".",
"HOURS",
")",
";",
"}"
] |
Retrieve a Synchro Duration from an input stream.
@param is input stream
@return Duration instance
|
[
"Retrieve",
"a",
"Synchro",
"Duration",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L301-L306
|
156,756
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
|
DatatypeConverter.getDouble
|
public static final Double getDouble(InputStream is) throws IOException
{
double result = Double.longBitsToDouble(getLong(is));
if (Double.isNaN(result))
{
result = 0;
}
return Double.valueOf(result);
}
|
java
|
public static final Double getDouble(InputStream is) throws IOException
{
double result = Double.longBitsToDouble(getLong(is));
if (Double.isNaN(result))
{
result = 0;
}
return Double.valueOf(result);
}
|
[
"public",
"static",
"final",
"Double",
"getDouble",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"double",
"result",
"=",
"Double",
".",
"longBitsToDouble",
"(",
"getLong",
"(",
"is",
")",
")",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"result",
")",
")",
"{",
"result",
"=",
"0",
";",
"}",
"return",
"Double",
".",
"valueOf",
"(",
"result",
")",
";",
"}"
] |
Retrieve a Double from an input stream.
@param is input stream
@return Double instance
|
[
"Retrieve",
"a",
"Double",
"from",
"an",
"input",
"stream",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L314-L322
|
156,757
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mpp/CustomFieldAliasReader.java
|
CustomFieldAliasReader.process
|
public void process()
{
if (m_data != null)
{
int index = 0;
int offset = 0;
// First the length (repeated twice)
int length = MPPUtility.getInt(m_data, offset);
offset += 8;
// Then the number of custom columns
int numberOfAliases = MPPUtility.getInt(m_data, offset);
offset += 4;
// Then the aliases themselves
while (index < numberOfAliases && offset < length)
{
// Each item consists of the Field ID (2 bytes), 40 0B marker (2 bytes), and the
// offset to the string (4 bytes)
// Get the Field ID
int fieldID = MPPUtility.getInt(m_data, offset);
offset += 4;
// Get the alias offset (offset + 4 for some reason).
int aliasOffset = MPPUtility.getInt(m_data, offset) + 4;
offset += 4;
// Read the alias itself
if (aliasOffset < m_data.length)
{
String alias = MPPUtility.getUnicodeString(m_data, aliasOffset);
m_fields.getCustomField(FieldTypeHelper.getInstance(fieldID)).setAlias(alias);
}
index++;
}
}
}
|
java
|
public void process()
{
if (m_data != null)
{
int index = 0;
int offset = 0;
// First the length (repeated twice)
int length = MPPUtility.getInt(m_data, offset);
offset += 8;
// Then the number of custom columns
int numberOfAliases = MPPUtility.getInt(m_data, offset);
offset += 4;
// Then the aliases themselves
while (index < numberOfAliases && offset < length)
{
// Each item consists of the Field ID (2 bytes), 40 0B marker (2 bytes), and the
// offset to the string (4 bytes)
// Get the Field ID
int fieldID = MPPUtility.getInt(m_data, offset);
offset += 4;
// Get the alias offset (offset + 4 for some reason).
int aliasOffset = MPPUtility.getInt(m_data, offset) + 4;
offset += 4;
// Read the alias itself
if (aliasOffset < m_data.length)
{
String alias = MPPUtility.getUnicodeString(m_data, aliasOffset);
m_fields.getCustomField(FieldTypeHelper.getInstance(fieldID)).setAlias(alias);
}
index++;
}
}
}
|
[
"public",
"void",
"process",
"(",
")",
"{",
"if",
"(",
"m_data",
"!=",
"null",
")",
"{",
"int",
"index",
"=",
"0",
";",
"int",
"offset",
"=",
"0",
";",
"// First the length (repeated twice)",
"int",
"length",
"=",
"MPPUtility",
".",
"getInt",
"(",
"m_data",
",",
"offset",
")",
";",
"offset",
"+=",
"8",
";",
"// Then the number of custom columns",
"int",
"numberOfAliases",
"=",
"MPPUtility",
".",
"getInt",
"(",
"m_data",
",",
"offset",
")",
";",
"offset",
"+=",
"4",
";",
"// Then the aliases themselves",
"while",
"(",
"index",
"<",
"numberOfAliases",
"&&",
"offset",
"<",
"length",
")",
"{",
"// Each item consists of the Field ID (2 bytes), 40 0B marker (2 bytes), and the",
"// offset to the string (4 bytes)",
"// Get the Field ID",
"int",
"fieldID",
"=",
"MPPUtility",
".",
"getInt",
"(",
"m_data",
",",
"offset",
")",
";",
"offset",
"+=",
"4",
";",
"// Get the alias offset (offset + 4 for some reason).",
"int",
"aliasOffset",
"=",
"MPPUtility",
".",
"getInt",
"(",
"m_data",
",",
"offset",
")",
"+",
"4",
";",
"offset",
"+=",
"4",
";",
"// Read the alias itself",
"if",
"(",
"aliasOffset",
"<",
"m_data",
".",
"length",
")",
"{",
"String",
"alias",
"=",
"MPPUtility",
".",
"getUnicodeString",
"(",
"m_data",
",",
"aliasOffset",
")",
";",
"m_fields",
".",
"getCustomField",
"(",
"FieldTypeHelper",
".",
"getInstance",
"(",
"fieldID",
")",
")",
".",
"setAlias",
"(",
"alias",
")",
";",
"}",
"index",
"++",
";",
"}",
"}",
"}"
] |
Process field aliases.
|
[
"Process",
"field",
"aliases",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CustomFieldAliasReader.java#L49-L83
|
156,758
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/primavera/schema/ProjectListType.java
|
ProjectListType.getProject
|
public List<ProjectListType.Project> getProject()
{
if (project == null)
{
project = new ArrayList<ProjectListType.Project>();
}
return this.project;
}
|
java
|
public List<ProjectListType.Project> getProject()
{
if (project == null)
{
project = new ArrayList<ProjectListType.Project>();
}
return this.project;
}
|
[
"public",
"List",
"<",
"ProjectListType",
".",
"Project",
">",
"getProject",
"(",
")",
"{",
"if",
"(",
"project",
"==",
"null",
")",
"{",
"project",
"=",
"new",
"ArrayList",
"<",
"ProjectListType",
".",
"Project",
">",
"(",
")",
";",
"}",
"return",
"this",
".",
"project",
";",
"}"
] |
Gets the value of the project property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the project property.
<p>
For example, to add a new item, do as follows:
<pre>
getProject().add(newItem);
</pre>
<p>
Objects of the following type(s) are allowed in the list
{@link ProjectListType.Project }
|
[
"Gets",
"the",
"value",
"of",
"the",
"project",
"property",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/schema/ProjectListType.java#L92-L99
|
156,759
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printExtendedAttributeCurrency
|
public static final String printExtendedAttributeCurrency(Number value)
{
return (value == null ? null : NUMBER_FORMAT.get().format(value.doubleValue() * 100));
}
|
java
|
public static final String printExtendedAttributeCurrency(Number value)
{
return (value == null ? null : NUMBER_FORMAT.get().format(value.doubleValue() * 100));
}
|
[
"public",
"static",
"final",
"String",
"printExtendedAttributeCurrency",
"(",
"Number",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"NUMBER_FORMAT",
".",
"get",
"(",
")",
".",
"format",
"(",
"value",
".",
"doubleValue",
"(",
")",
"*",
"100",
")",
")",
";",
"}"
] |
Print an extended attribute currency value.
@param value currency value
@return string representation
|
[
"Print",
"an",
"extended",
"attribute",
"currency",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L71-L74
|
156,760
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseExtendedAttributeCurrency
|
public static final Number parseExtendedAttributeCurrency(String value)
{
Number result;
if (value == null)
{
result = null;
}
else
{
result = NumberHelper.getDouble(Double.parseDouble(correctNumberFormat(value)) / 100);
}
return result;
}
|
java
|
public static final Number parseExtendedAttributeCurrency(String value)
{
Number result;
if (value == null)
{
result = null;
}
else
{
result = NumberHelper.getDouble(Double.parseDouble(correctNumberFormat(value)) / 100);
}
return result;
}
|
[
"public",
"static",
"final",
"Number",
"parseExtendedAttributeCurrency",
"(",
"String",
"value",
")",
"{",
"Number",
"result",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"result",
"=",
"null",
";",
"}",
"else",
"{",
"result",
"=",
"NumberHelper",
".",
"getDouble",
"(",
"Double",
".",
"parseDouble",
"(",
"correctNumberFormat",
"(",
"value",
")",
")",
"/",
"100",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Parse an extended attribute currency value.
@param value string representation
@return currency value
|
[
"Parse",
"an",
"extended",
"attribute",
"currency",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L82-L95
|
156,761
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseExtendedAttributeBoolean
|
public static final Boolean parseExtendedAttributeBoolean(String value)
{
return ((value.equals("1") ? Boolean.TRUE : Boolean.FALSE));
}
|
java
|
public static final Boolean parseExtendedAttributeBoolean(String value)
{
return ((value.equals("1") ? Boolean.TRUE : Boolean.FALSE));
}
|
[
"public",
"static",
"final",
"Boolean",
"parseExtendedAttributeBoolean",
"(",
"String",
"value",
")",
"{",
"return",
"(",
"(",
"value",
".",
"equals",
"(",
"\"1\"",
")",
"?",
"Boolean",
".",
"TRUE",
":",
"Boolean",
".",
"FALSE",
")",
")",
";",
"}"
] |
Parse an extended attribute boolean value.
@param value string representation
@return boolean value
|
[
"Parse",
"an",
"extended",
"attribute",
"boolean",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L136-L139
|
156,762
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printExtendedAttributeDate
|
public static final String printExtendedAttributeDate(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
}
|
java
|
public static final String printExtendedAttributeDate(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
}
|
[
"public",
"static",
"final",
"String",
"printExtendedAttributeDate",
"(",
"Date",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"DATE_FORMAT",
".",
"get",
"(",
")",
".",
"format",
"(",
"value",
")",
")",
";",
"}"
] |
Print an extended attribute date value.
@param value date value
@return string representation
|
[
"Print",
"an",
"extended",
"attribute",
"date",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L147-L150
|
156,763
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseExtendedAttributeDate
|
public static final Date parseExtendedAttributeDate(String value)
{
Date result = null;
if (value != null)
{
try
{
result = DATE_FORMAT.get().parse(value);
}
catch (ParseException ex)
{
// ignore exceptions
}
}
return (result);
}
|
java
|
public static final Date parseExtendedAttributeDate(String value)
{
Date result = null;
if (value != null)
{
try
{
result = DATE_FORMAT.get().parse(value);
}
catch (ParseException ex)
{
// ignore exceptions
}
}
return (result);
}
|
[
"public",
"static",
"final",
"Date",
"parseExtendedAttributeDate",
"(",
"String",
"value",
")",
"{",
"Date",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"try",
"{",
"result",
"=",
"DATE_FORMAT",
".",
"get",
"(",
")",
".",
"parse",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"ParseException",
"ex",
")",
"{",
"// ignore exceptions",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse an extended attribute date value.
@param value string representation
@return date value
|
[
"Parse",
"an",
"extended",
"attribute",
"date",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L158-L176
|
156,764
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printExtendedAttribute
|
public static final String printExtendedAttribute(MSPDIWriter writer, Object value, DataType type)
{
String result;
if (type == DataType.DATE)
{
result = printExtendedAttributeDate((Date) value);
}
else
{
if (value instanceof Boolean)
{
result = printExtendedAttributeBoolean((Boolean) value);
}
else
{
if (value instanceof Duration)
{
result = printDuration(writer, (Duration) value);
}
else
{
if (type == DataType.CURRENCY)
{
result = printExtendedAttributeCurrency((Number) value);
}
else
{
if (value instanceof Number)
{
result = printExtendedAttributeNumber((Number) value);
}
else
{
result = value.toString();
}
}
}
}
}
return (result);
}
|
java
|
public static final String printExtendedAttribute(MSPDIWriter writer, Object value, DataType type)
{
String result;
if (type == DataType.DATE)
{
result = printExtendedAttributeDate((Date) value);
}
else
{
if (value instanceof Boolean)
{
result = printExtendedAttributeBoolean((Boolean) value);
}
else
{
if (value instanceof Duration)
{
result = printDuration(writer, (Duration) value);
}
else
{
if (type == DataType.CURRENCY)
{
result = printExtendedAttributeCurrency((Number) value);
}
else
{
if (value instanceof Number)
{
result = printExtendedAttributeNumber((Number) value);
}
else
{
result = value.toString();
}
}
}
}
}
return (result);
}
|
[
"public",
"static",
"final",
"String",
"printExtendedAttribute",
"(",
"MSPDIWriter",
"writer",
",",
"Object",
"value",
",",
"DataType",
"type",
")",
"{",
"String",
"result",
";",
"if",
"(",
"type",
"==",
"DataType",
".",
"DATE",
")",
"{",
"result",
"=",
"printExtendedAttributeDate",
"(",
"(",
"Date",
")",
"value",
")",
";",
"}",
"else",
"{",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"result",
"=",
"printExtendedAttributeBoolean",
"(",
"(",
"Boolean",
")",
"value",
")",
";",
"}",
"else",
"{",
"if",
"(",
"value",
"instanceof",
"Duration",
")",
"{",
"result",
"=",
"printDuration",
"(",
"writer",
",",
"(",
"Duration",
")",
"value",
")",
";",
"}",
"else",
"{",
"if",
"(",
"type",
"==",
"DataType",
".",
"CURRENCY",
")",
"{",
"result",
"=",
"printExtendedAttributeCurrency",
"(",
"(",
"Number",
")",
"value",
")",
";",
"}",
"else",
"{",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"{",
"result",
"=",
"printExtendedAttributeNumber",
"(",
"(",
"Number",
")",
"value",
")",
";",
"}",
"else",
"{",
"result",
"=",
"value",
".",
"toString",
"(",
")",
";",
"}",
"}",
"}",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Print an extended attribute value.
@param writer parent MSPDIWriter instance
@param value attribute value
@param type type of the value being passed
@return string representation
|
[
"Print",
"an",
"extended",
"attribute",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L186-L228
|
156,765
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseExtendedAttribute
|
public static final void parseExtendedAttribute(ProjectFile file, FieldContainer mpx, String value, FieldType mpxFieldID, TimeUnit durationFormat)
{
if (mpxFieldID != null)
{
switch (mpxFieldID.getDataType())
{
case STRING:
{
mpx.set(mpxFieldID, value);
break;
}
case DATE:
{
mpx.set(mpxFieldID, parseExtendedAttributeDate(value));
break;
}
case CURRENCY:
{
mpx.set(mpxFieldID, parseExtendedAttributeCurrency(value));
break;
}
case BOOLEAN:
{
mpx.set(mpxFieldID, parseExtendedAttributeBoolean(value));
break;
}
case NUMERIC:
{
mpx.set(mpxFieldID, parseExtendedAttributeNumber(value));
break;
}
case DURATION:
{
mpx.set(mpxFieldID, parseDuration(file, durationFormat, value));
break;
}
default:
{
break;
}
}
}
}
|
java
|
public static final void parseExtendedAttribute(ProjectFile file, FieldContainer mpx, String value, FieldType mpxFieldID, TimeUnit durationFormat)
{
if (mpxFieldID != null)
{
switch (mpxFieldID.getDataType())
{
case STRING:
{
mpx.set(mpxFieldID, value);
break;
}
case DATE:
{
mpx.set(mpxFieldID, parseExtendedAttributeDate(value));
break;
}
case CURRENCY:
{
mpx.set(mpxFieldID, parseExtendedAttributeCurrency(value));
break;
}
case BOOLEAN:
{
mpx.set(mpxFieldID, parseExtendedAttributeBoolean(value));
break;
}
case NUMERIC:
{
mpx.set(mpxFieldID, parseExtendedAttributeNumber(value));
break;
}
case DURATION:
{
mpx.set(mpxFieldID, parseDuration(file, durationFormat, value));
break;
}
default:
{
break;
}
}
}
}
|
[
"public",
"static",
"final",
"void",
"parseExtendedAttribute",
"(",
"ProjectFile",
"file",
",",
"FieldContainer",
"mpx",
",",
"String",
"value",
",",
"FieldType",
"mpxFieldID",
",",
"TimeUnit",
"durationFormat",
")",
"{",
"if",
"(",
"mpxFieldID",
"!=",
"null",
")",
"{",
"switch",
"(",
"mpxFieldID",
".",
"getDataType",
"(",
")",
")",
"{",
"case",
"STRING",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"value",
")",
";",
"break",
";",
"}",
"case",
"DATE",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"parseExtendedAttributeDate",
"(",
"value",
")",
")",
";",
"break",
";",
"}",
"case",
"CURRENCY",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"parseExtendedAttributeCurrency",
"(",
"value",
")",
")",
";",
"break",
";",
"}",
"case",
"BOOLEAN",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"parseExtendedAttributeBoolean",
"(",
"value",
")",
")",
";",
"break",
";",
"}",
"case",
"NUMERIC",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"parseExtendedAttributeNumber",
"(",
"value",
")",
")",
";",
"break",
";",
"}",
"case",
"DURATION",
":",
"{",
"mpx",
".",
"set",
"(",
"mpxFieldID",
",",
"parseDuration",
"(",
"file",
",",
"durationFormat",
",",
"value",
")",
")",
";",
"break",
";",
"}",
"default",
":",
"{",
"break",
";",
"}",
"}",
"}",
"}"
] |
Parse an extended attribute value.
@param file parent file
@param mpx parent entity
@param value string value
@param mpxFieldID field ID
@param durationFormat duration format associated with the extended attribute
|
[
"Parse",
"an",
"extended",
"attribute",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L239-L287
|
156,766
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printCurrencySymbolPosition
|
public static final String printCurrencySymbolPosition(CurrencySymbolPosition value)
{
String result;
switch (value)
{
default:
case BEFORE:
{
result = "0";
break;
}
case AFTER:
{
result = "1";
break;
}
case BEFORE_WITH_SPACE:
{
result = "2";
break;
}
case AFTER_WITH_SPACE:
{
result = "3";
break;
}
}
return (result);
}
|
java
|
public static final String printCurrencySymbolPosition(CurrencySymbolPosition value)
{
String result;
switch (value)
{
default:
case BEFORE:
{
result = "0";
break;
}
case AFTER:
{
result = "1";
break;
}
case BEFORE_WITH_SPACE:
{
result = "2";
break;
}
case AFTER_WITH_SPACE:
{
result = "3";
break;
}
}
return (result);
}
|
[
"public",
"static",
"final",
"String",
"printCurrencySymbolPosition",
"(",
"CurrencySymbolPosition",
"value",
")",
"{",
"String",
"result",
";",
"switch",
"(",
"value",
")",
"{",
"default",
":",
"case",
"BEFORE",
":",
"{",
"result",
"=",
"\"0\"",
";",
"break",
";",
"}",
"case",
"AFTER",
":",
"{",
"result",
"=",
"\"1\"",
";",
"break",
";",
"}",
"case",
"BEFORE_WITH_SPACE",
":",
"{",
"result",
"=",
"\"2\"",
";",
"break",
";",
"}",
"case",
"AFTER_WITH_SPACE",
":",
"{",
"result",
"=",
"\"3\"",
";",
"break",
";",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Prints a currency symbol position value.
@param value CurrencySymbolPosition instance
@return currency symbol position
|
[
"Prints",
"a",
"currency",
"symbol",
"position",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L295-L328
|
156,767
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseCurrencySymbolPosition
|
public static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
{
CurrencySymbolPosition result = CurrencySymbolPosition.BEFORE;
switch (NumberHelper.getInt(value))
{
case 0:
{
result = CurrencySymbolPosition.BEFORE;
break;
}
case 1:
{
result = CurrencySymbolPosition.AFTER;
break;
}
case 2:
{
result = CurrencySymbolPosition.BEFORE_WITH_SPACE;
break;
}
case 3:
{
result = CurrencySymbolPosition.AFTER_WITH_SPACE;
break;
}
}
return (result);
}
|
java
|
public static final CurrencySymbolPosition parseCurrencySymbolPosition(String value)
{
CurrencySymbolPosition result = CurrencySymbolPosition.BEFORE;
switch (NumberHelper.getInt(value))
{
case 0:
{
result = CurrencySymbolPosition.BEFORE;
break;
}
case 1:
{
result = CurrencySymbolPosition.AFTER;
break;
}
case 2:
{
result = CurrencySymbolPosition.BEFORE_WITH_SPACE;
break;
}
case 3:
{
result = CurrencySymbolPosition.AFTER_WITH_SPACE;
break;
}
}
return (result);
}
|
[
"public",
"static",
"final",
"CurrencySymbolPosition",
"parseCurrencySymbolPosition",
"(",
"String",
"value",
")",
"{",
"CurrencySymbolPosition",
"result",
"=",
"CurrencySymbolPosition",
".",
"BEFORE",
";",
"switch",
"(",
"NumberHelper",
".",
"getInt",
"(",
"value",
")",
")",
"{",
"case",
"0",
":",
"{",
"result",
"=",
"CurrencySymbolPosition",
".",
"BEFORE",
";",
"break",
";",
"}",
"case",
"1",
":",
"{",
"result",
"=",
"CurrencySymbolPosition",
".",
"AFTER",
";",
"break",
";",
"}",
"case",
"2",
":",
"{",
"result",
"=",
"CurrencySymbolPosition",
".",
"BEFORE_WITH_SPACE",
";",
"break",
";",
"}",
"case",
"3",
":",
"{",
"result",
"=",
"CurrencySymbolPosition",
".",
"AFTER_WITH_SPACE",
";",
"break",
";",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse a currency symbol position value.
@param value currency symbol position
@return CurrencySymbolPosition instance
|
[
"Parse",
"a",
"currency",
"symbol",
"position",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L336-L368
|
156,768
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printAccrueType
|
public static final String printAccrueType(AccrueType value)
{
return (Integer.toString(value == null ? AccrueType.PRORATED.getValue() : value.getValue()));
}
|
java
|
public static final String printAccrueType(AccrueType value)
{
return (Integer.toString(value == null ? AccrueType.PRORATED.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printAccrueType",
"(",
"AccrueType",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"AccrueType",
".",
"PRORATED",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print an accrue type.
@param value AccrueType instance
@return accrue type value
|
[
"Print",
"an",
"accrue",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L376-L379
|
156,769
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printResourceType
|
public static final String printResourceType(ResourceType value)
{
return (Integer.toString(value == null ? ResourceType.WORK.getValue() : value.getValue()));
}
|
java
|
public static final String printResourceType(ResourceType value)
{
return (Integer.toString(value == null ? ResourceType.WORK.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printResourceType",
"(",
"ResourceType",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"ResourceType",
".",
"WORK",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a resource type.
@param value ResourceType instance
@return resource type value
|
[
"Print",
"a",
"resource",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L398-L401
|
156,770
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printWorkGroup
|
public static final String printWorkGroup(WorkGroup value)
{
return (Integer.toString(value == null ? WorkGroup.DEFAULT.getValue() : value.getValue()));
}
|
java
|
public static final String printWorkGroup(WorkGroup value)
{
return (Integer.toString(value == null ? WorkGroup.DEFAULT.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printWorkGroup",
"(",
"WorkGroup",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"WorkGroup",
".",
"DEFAULT",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a work group.
@param value WorkGroup instance
@return work group value
|
[
"Print",
"a",
"work",
"group",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L420-L423
|
156,771
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printWorkContour
|
public static final String printWorkContour(WorkContour value)
{
return (Integer.toString(value == null ? WorkContour.FLAT.getValue() : value.getValue()));
}
|
java
|
public static final String printWorkContour(WorkContour value)
{
return (Integer.toString(value == null ? WorkContour.FLAT.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printWorkContour",
"(",
"WorkContour",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"WorkContour",
".",
"FLAT",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a work contour.
@param value WorkContour instance
@return work contour value
|
[
"Print",
"a",
"work",
"contour",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L442-L445
|
156,772
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printBookingType
|
public static final String printBookingType(BookingType value)
{
return (Integer.toString(value == null ? BookingType.COMMITTED.getValue() : value.getValue()));
}
|
java
|
public static final String printBookingType(BookingType value)
{
return (Integer.toString(value == null ? BookingType.COMMITTED.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printBookingType",
"(",
"BookingType",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"BookingType",
".",
"COMMITTED",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a booking type.
@param value BookingType instance
@return booking type value
|
[
"Print",
"a",
"booking",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L464-L467
|
156,773
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printTaskType
|
public static final String printTaskType(TaskType value)
{
return (Integer.toString(value == null ? TaskType.FIXED_UNITS.getValue() : value.getValue()));
}
|
java
|
public static final String printTaskType(TaskType value)
{
return (Integer.toString(value == null ? TaskType.FIXED_UNITS.getValue() : value.getValue()));
}
|
[
"public",
"static",
"final",
"String",
"printTaskType",
"(",
"TaskType",
"value",
")",
"{",
"return",
"(",
"Integer",
".",
"toString",
"(",
"value",
"==",
"null",
"?",
"TaskType",
".",
"FIXED_UNITS",
".",
"getValue",
"(",
")",
":",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a task type.
@param value TaskType instance
@return task type value
|
[
"Print",
"a",
"task",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L486-L489
|
156,774
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printEarnedValueMethod
|
public static final BigInteger printEarnedValueMethod(EarnedValueMethod value)
{
return (value == null ? BigInteger.valueOf(EarnedValueMethod.PERCENT_COMPLETE.getValue()) : BigInteger.valueOf(value.getValue()));
}
|
java
|
public static final BigInteger printEarnedValueMethod(EarnedValueMethod value)
{
return (value == null ? BigInteger.valueOf(EarnedValueMethod.PERCENT_COMPLETE.getValue()) : BigInteger.valueOf(value.getValue()));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printEarnedValueMethod",
"(",
"EarnedValueMethod",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"BigInteger",
".",
"valueOf",
"(",
"EarnedValueMethod",
".",
"PERCENT_COMPLETE",
".",
"getValue",
"(",
")",
")",
":",
"BigInteger",
".",
"valueOf",
"(",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print an earned value method.
@param value EarnedValueMethod instance
@return earned value method value
|
[
"Print",
"an",
"earned",
"value",
"method",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L508-L511
|
156,775
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printUnits
|
public static final BigDecimal printUnits(Number value)
{
return (value == null ? BIGDECIMAL_ONE : new BigDecimal(value.doubleValue() / 100));
}
|
java
|
public static final BigDecimal printUnits(Number value)
{
return (value == null ? BIGDECIMAL_ONE : new BigDecimal(value.doubleValue() / 100));
}
|
[
"public",
"static",
"final",
"BigDecimal",
"printUnits",
"(",
"Number",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"BIGDECIMAL_ONE",
":",
"new",
"BigDecimal",
"(",
"value",
".",
"doubleValue",
"(",
")",
"/",
"100",
")",
")",
";",
"}"
] |
Print units.
@param value units value
@return units value
|
[
"Print",
"units",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L530-L533
|
156,776
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseUnits
|
public static final Number parseUnits(Number value)
{
return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
}
|
java
|
public static final Number parseUnits(Number value)
{
return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
}
|
[
"public",
"static",
"final",
"Number",
"parseUnits",
"(",
"Number",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"NumberHelper",
".",
"getDouble",
"(",
"value",
".",
"doubleValue",
"(",
")",
"*",
"100",
")",
")",
";",
"}"
] |
Parse units.
@param value units value
@return units value
|
[
"Parse",
"units",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L541-L544
|
156,777
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printTimeUnit
|
public static final BigInteger printTimeUnit(TimeUnit value)
{
return (BigInteger.valueOf(value == null ? TimeUnit.DAYS.getValue() + 1 : value.getValue() + 1));
}
|
java
|
public static final BigInteger printTimeUnit(TimeUnit value)
{
return (BigInteger.valueOf(value == null ? TimeUnit.DAYS.getValue() + 1 : value.getValue() + 1));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printTimeUnit",
"(",
"TimeUnit",
"value",
")",
"{",
"return",
"(",
"BigInteger",
".",
"valueOf",
"(",
"value",
"==",
"null",
"?",
"TimeUnit",
".",
"DAYS",
".",
"getValue",
"(",
")",
"+",
"1",
":",
"value",
".",
"getValue",
"(",
")",
"+",
"1",
")",
")",
";",
"}"
] |
Print time unit.
@param value TimeUnit instance
@return time unit value
|
[
"Print",
"time",
"unit",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L552-L555
|
156,778
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseWorkUnits
|
public static final TimeUnit parseWorkUnits(BigInteger value)
{
TimeUnit result = TimeUnit.HOURS;
if (value != null)
{
switch (value.intValue())
{
case 1:
{
result = TimeUnit.MINUTES;
break;
}
case 3:
{
result = TimeUnit.DAYS;
break;
}
case 4:
{
result = TimeUnit.WEEKS;
break;
}
case 5:
{
result = TimeUnit.MONTHS;
break;
}
case 7:
{
result = TimeUnit.YEARS;
break;
}
default:
case 2:
{
result = TimeUnit.HOURS;
break;
}
}
}
return (result);
}
|
java
|
public static final TimeUnit parseWorkUnits(BigInteger value)
{
TimeUnit result = TimeUnit.HOURS;
if (value != null)
{
switch (value.intValue())
{
case 1:
{
result = TimeUnit.MINUTES;
break;
}
case 3:
{
result = TimeUnit.DAYS;
break;
}
case 4:
{
result = TimeUnit.WEEKS;
break;
}
case 5:
{
result = TimeUnit.MONTHS;
break;
}
case 7:
{
result = TimeUnit.YEARS;
break;
}
default:
case 2:
{
result = TimeUnit.HOURS;
break;
}
}
}
return (result);
}
|
[
"public",
"static",
"final",
"TimeUnit",
"parseWorkUnits",
"(",
"BigInteger",
"value",
")",
"{",
"TimeUnit",
"result",
"=",
"TimeUnit",
".",
"HOURS",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"switch",
"(",
"value",
".",
"intValue",
"(",
")",
")",
"{",
"case",
"1",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"MINUTES",
";",
"break",
";",
"}",
"case",
"3",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"DAYS",
";",
"break",
";",
"}",
"case",
"4",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"WEEKS",
";",
"break",
";",
"}",
"case",
"5",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"MONTHS",
";",
"break",
";",
"}",
"case",
"7",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"YEARS",
";",
"break",
";",
"}",
"default",
":",
"case",
"2",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"HOURS",
";",
"break",
";",
"}",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse work units.
@param value work units value
@return TimeUnit instance
|
[
"Parse",
"work",
"units",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L592-L640
|
156,779
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printWorkUnits
|
public static final BigInteger printWorkUnits(TimeUnit value)
{
int result;
if (value == null)
{
value = TimeUnit.HOURS;
}
switch (value)
{
case MINUTES:
{
result = 1;
break;
}
case DAYS:
{
result = 3;
break;
}
case WEEKS:
{
result = 4;
break;
}
case MONTHS:
{
result = 5;
break;
}
case YEARS:
{
result = 7;
break;
}
default:
case HOURS:
{
result = 2;
break;
}
}
return (BigInteger.valueOf(result));
}
|
java
|
public static final BigInteger printWorkUnits(TimeUnit value)
{
int result;
if (value == null)
{
value = TimeUnit.HOURS;
}
switch (value)
{
case MINUTES:
{
result = 1;
break;
}
case DAYS:
{
result = 3;
break;
}
case WEEKS:
{
result = 4;
break;
}
case MONTHS:
{
result = 5;
break;
}
case YEARS:
{
result = 7;
break;
}
default:
case HOURS:
{
result = 2;
break;
}
}
return (BigInteger.valueOf(result));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printWorkUnits",
"(",
"TimeUnit",
"value",
")",
"{",
"int",
"result",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"TimeUnit",
".",
"HOURS",
";",
"}",
"switch",
"(",
"value",
")",
"{",
"case",
"MINUTES",
":",
"{",
"result",
"=",
"1",
";",
"break",
";",
"}",
"case",
"DAYS",
":",
"{",
"result",
"=",
"3",
";",
"break",
";",
"}",
"case",
"WEEKS",
":",
"{",
"result",
"=",
"4",
";",
"break",
";",
"}",
"case",
"MONTHS",
":",
"{",
"result",
"=",
"5",
";",
"break",
";",
"}",
"case",
"YEARS",
":",
"{",
"result",
"=",
"7",
";",
"break",
";",
"}",
"default",
":",
"case",
"HOURS",
":",
"{",
"result",
"=",
"2",
";",
"break",
";",
"}",
"}",
"return",
"(",
"BigInteger",
".",
"valueOf",
"(",
"result",
")",
")",
";",
"}"
] |
Print work units.
@param value TimeUnit instance
@return work units value
|
[
"Print",
"work",
"units",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L648-L698
|
156,780
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseCurrency
|
public static final Double parseCurrency(Number value)
{
return (value == null ? null : NumberHelper.getDouble(value.doubleValue() / 100));
}
|
java
|
public static final Double parseCurrency(Number value)
{
return (value == null ? null : NumberHelper.getDouble(value.doubleValue() / 100));
}
|
[
"public",
"static",
"final",
"Double",
"parseCurrency",
"(",
"Number",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"NumberHelper",
".",
"getDouble",
"(",
"value",
".",
"doubleValue",
"(",
")",
"/",
"100",
")",
")",
";",
"}"
] |
Parse currency.
@param value currency value
@return currency value
|
[
"Parse",
"currency",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1007-L1010
|
156,781
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printCurrency
|
public static final BigDecimal printCurrency(Number value)
{
return (value == null || value.doubleValue() == 0 ? null : new BigDecimal(value.doubleValue() * 100));
}
|
java
|
public static final BigDecimal printCurrency(Number value)
{
return (value == null || value.doubleValue() == 0 ? null : new BigDecimal(value.doubleValue() * 100));
}
|
[
"public",
"static",
"final",
"BigDecimal",
"printCurrency",
"(",
"Number",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"doubleValue",
"(",
")",
"==",
"0",
"?",
"null",
":",
"new",
"BigDecimal",
"(",
"value",
".",
"doubleValue",
"(",
")",
"*",
"100",
")",
")",
";",
"}"
] |
Print currency.
@param value currency value
@return currency value
|
[
"Print",
"currency",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1018-L1021
|
156,782
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseDurationTimeUnits
|
public static final TimeUnit parseDurationTimeUnits(BigInteger value, TimeUnit defaultValue)
{
TimeUnit result = defaultValue;
if (value != null)
{
switch (value.intValue())
{
case 3:
case 35:
{
result = TimeUnit.MINUTES;
break;
}
case 4:
case 36:
{
result = TimeUnit.ELAPSED_MINUTES;
break;
}
case 5:
case 37:
{
result = TimeUnit.HOURS;
break;
}
case 6:
case 38:
{
result = TimeUnit.ELAPSED_HOURS;
break;
}
case 7:
case 39:
case 53:
{
result = TimeUnit.DAYS;
break;
}
case 8:
case 40:
{
result = TimeUnit.ELAPSED_DAYS;
break;
}
case 9:
case 41:
{
result = TimeUnit.WEEKS;
break;
}
case 10:
case 42:
{
result = TimeUnit.ELAPSED_WEEKS;
break;
}
case 11:
case 43:
{
result = TimeUnit.MONTHS;
break;
}
case 12:
case 44:
{
result = TimeUnit.ELAPSED_MONTHS;
break;
}
case 19:
case 51:
{
result = TimeUnit.PERCENT;
break;
}
case 20:
case 52:
{
result = TimeUnit.ELAPSED_PERCENT;
break;
}
default:
{
result = PARENT_FILE.get().getProjectProperties().getDefaultDurationUnits();
break;
}
}
}
return (result);
}
|
java
|
public static final TimeUnit parseDurationTimeUnits(BigInteger value, TimeUnit defaultValue)
{
TimeUnit result = defaultValue;
if (value != null)
{
switch (value.intValue())
{
case 3:
case 35:
{
result = TimeUnit.MINUTES;
break;
}
case 4:
case 36:
{
result = TimeUnit.ELAPSED_MINUTES;
break;
}
case 5:
case 37:
{
result = TimeUnit.HOURS;
break;
}
case 6:
case 38:
{
result = TimeUnit.ELAPSED_HOURS;
break;
}
case 7:
case 39:
case 53:
{
result = TimeUnit.DAYS;
break;
}
case 8:
case 40:
{
result = TimeUnit.ELAPSED_DAYS;
break;
}
case 9:
case 41:
{
result = TimeUnit.WEEKS;
break;
}
case 10:
case 42:
{
result = TimeUnit.ELAPSED_WEEKS;
break;
}
case 11:
case 43:
{
result = TimeUnit.MONTHS;
break;
}
case 12:
case 44:
{
result = TimeUnit.ELAPSED_MONTHS;
break;
}
case 19:
case 51:
{
result = TimeUnit.PERCENT;
break;
}
case 20:
case 52:
{
result = TimeUnit.ELAPSED_PERCENT;
break;
}
default:
{
result = PARENT_FILE.get().getProjectProperties().getDefaultDurationUnits();
break;
}
}
}
return (result);
}
|
[
"public",
"static",
"final",
"TimeUnit",
"parseDurationTimeUnits",
"(",
"BigInteger",
"value",
",",
"TimeUnit",
"defaultValue",
")",
"{",
"TimeUnit",
"result",
"=",
"defaultValue",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"switch",
"(",
"value",
".",
"intValue",
"(",
")",
")",
"{",
"case",
"3",
":",
"case",
"35",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"MINUTES",
";",
"break",
";",
"}",
"case",
"4",
":",
"case",
"36",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_MINUTES",
";",
"break",
";",
"}",
"case",
"5",
":",
"case",
"37",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"HOURS",
";",
"break",
";",
"}",
"case",
"6",
":",
"case",
"38",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_HOURS",
";",
"break",
";",
"}",
"case",
"7",
":",
"case",
"39",
":",
"case",
"53",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"DAYS",
";",
"break",
";",
"}",
"case",
"8",
":",
"case",
"40",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_DAYS",
";",
"break",
";",
"}",
"case",
"9",
":",
"case",
"41",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"WEEKS",
";",
"break",
";",
"}",
"case",
"10",
":",
"case",
"42",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_WEEKS",
";",
"break",
";",
"}",
"case",
"11",
":",
"case",
"43",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"MONTHS",
";",
"break",
";",
"}",
"case",
"12",
":",
"case",
"44",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_MONTHS",
";",
"break",
";",
"}",
"case",
"19",
":",
"case",
"51",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"PERCENT",
";",
"break",
";",
"}",
"case",
"20",
":",
"case",
"52",
":",
"{",
"result",
"=",
"TimeUnit",
".",
"ELAPSED_PERCENT",
";",
"break",
";",
"}",
"default",
":",
"{",
"result",
"=",
"PARENT_FILE",
".",
"get",
"(",
")",
".",
"getProjectProperties",
"(",
")",
".",
"getDefaultDurationUnits",
"(",
")",
";",
"break",
";",
"}",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse duration time units.
Note that we don't differentiate between confirmed and unconfirmed
durations. Unrecognised duration types are default the supplied default value.
@param value BigInteger value
@param defaultValue if value is null, use this value as the result
@return Duration units
|
[
"Parse",
"duration",
"time",
"units",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1047-L1149
|
156,783
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parsePriority
|
public static final Priority parsePriority(BigInteger priority)
{
return (priority == null ? null : Priority.getInstance(priority.intValue()));
}
|
java
|
public static final Priority parsePriority(BigInteger priority)
{
return (priority == null ? null : Priority.getInstance(priority.intValue()));
}
|
[
"public",
"static",
"final",
"Priority",
"parsePriority",
"(",
"BigInteger",
"priority",
")",
"{",
"return",
"(",
"priority",
"==",
"null",
"?",
"null",
":",
"Priority",
".",
"getInstance",
"(",
"priority",
".",
"intValue",
"(",
")",
")",
")",
";",
"}"
] |
Parse priority.
@param priority priority value
@return Priority instance
|
[
"Parse",
"priority",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1256-L1259
|
156,784
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printPriority
|
public static final BigInteger printPriority(Priority priority)
{
int result = Priority.MEDIUM;
if (priority != null)
{
result = priority.getValue();
}
return (BigInteger.valueOf(result));
}
|
java
|
public static final BigInteger printPriority(Priority priority)
{
int result = Priority.MEDIUM;
if (priority != null)
{
result = priority.getValue();
}
return (BigInteger.valueOf(result));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printPriority",
"(",
"Priority",
"priority",
")",
"{",
"int",
"result",
"=",
"Priority",
".",
"MEDIUM",
";",
"if",
"(",
"priority",
"!=",
"null",
")",
"{",
"result",
"=",
"priority",
".",
"getValue",
"(",
")",
";",
"}",
"return",
"(",
"BigInteger",
".",
"valueOf",
"(",
"result",
")",
")",
";",
"}"
] |
Print priority.
@param priority Priority instance
@return priority value
|
[
"Print",
"priority",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1267-L1277
|
156,785
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseDurationInThousanthsOfMinutes
|
public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
}
|
java
|
public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
}
|
[
"public",
"static",
"final",
"Duration",
"parseDurationInThousanthsOfMinutes",
"(",
"ProjectProperties",
"properties",
",",
"Number",
"value",
",",
"TimeUnit",
"targetTimeUnit",
")",
"{",
"return",
"parseDurationInFractionsOfMinutes",
"(",
"properties",
",",
"value",
",",
"targetTimeUnit",
",",
"1000",
")",
";",
"}"
] |
Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@return Duration instance
|
[
"Parse",
"duration",
"represented",
"in",
"thousandths",
"of",
"minutes",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1309-L1312
|
156,786
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printDurationInDecimalThousandthsOfMinutes
|
public static final BigDecimal printDurationInDecimalThousandthsOfMinutes(Duration duration)
{
BigDecimal result = null;
if (duration != null && duration.getDuration() != 0)
{
result = BigDecimal.valueOf(printDurationFractionsOfMinutes(duration, 1000));
}
return result;
}
|
java
|
public static final BigDecimal printDurationInDecimalThousandthsOfMinutes(Duration duration)
{
BigDecimal result = null;
if (duration != null && duration.getDuration() != 0)
{
result = BigDecimal.valueOf(printDurationFractionsOfMinutes(duration, 1000));
}
return result;
}
|
[
"public",
"static",
"final",
"BigDecimal",
"printDurationInDecimalThousandthsOfMinutes",
"(",
"Duration",
"duration",
")",
"{",
"BigDecimal",
"result",
"=",
"null",
";",
"if",
"(",
"duration",
"!=",
"null",
"&&",
"duration",
".",
"getDuration",
"(",
")",
"!=",
"0",
")",
"{",
"result",
"=",
"BigDecimal",
".",
"valueOf",
"(",
"printDurationFractionsOfMinutes",
"(",
"duration",
",",
"1000",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Print duration in thousandths of minutes.
@param duration Duration instance
@return duration in thousandths of minutes
|
[
"Print",
"duration",
"in",
"thousandths",
"of",
"minutes",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1349-L1357
|
156,787
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printDurationInIntegerTenthsOfMinutes
|
public static final BigInteger printDurationInIntegerTenthsOfMinutes(Duration duration)
{
BigInteger result = null;
if (duration != null && duration.getDuration() != 0)
{
result = BigInteger.valueOf((long) printDurationFractionsOfMinutes(duration, 10));
}
return result;
}
|
java
|
public static final BigInteger printDurationInIntegerTenthsOfMinutes(Duration duration)
{
BigInteger result = null;
if (duration != null && duration.getDuration() != 0)
{
result = BigInteger.valueOf((long) printDurationFractionsOfMinutes(duration, 10));
}
return result;
}
|
[
"public",
"static",
"final",
"BigInteger",
"printDurationInIntegerTenthsOfMinutes",
"(",
"Duration",
"duration",
")",
"{",
"BigInteger",
"result",
"=",
"null",
";",
"if",
"(",
"duration",
"!=",
"null",
"&&",
"duration",
".",
"getDuration",
"(",
")",
"!=",
"0",
")",
"{",
"result",
"=",
"BigInteger",
".",
"valueOf",
"(",
"(",
"long",
")",
"printDurationFractionsOfMinutes",
"(",
"duration",
",",
"10",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Print duration in tenths of minutes.
@param duration Duration instance
@return duration in tenths of minutes
|
[
"Print",
"duration",
"in",
"tenths",
"of",
"minutes",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1365-L1375
|
156,788
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseUUID
|
public static final UUID parseUUID(String value)
{
return value == null || value.isEmpty() ? null : UUID.fromString(value);
}
|
java
|
public static final UUID parseUUID(String value)
{
return value == null || value.isEmpty() ? null : UUID.fromString(value);
}
|
[
"public",
"static",
"final",
"UUID",
"parseUUID",
"(",
"String",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"||",
"value",
".",
"isEmpty",
"(",
")",
"?",
"null",
":",
"UUID",
".",
"fromString",
"(",
"value",
")",
";",
"}"
] |
Convert the MSPDI representation of a UUID into a Java UUID instance.
@param value MSPDI UUID
@return Java UUID instance
|
[
"Convert",
"the",
"MSPDI",
"representation",
"of",
"a",
"UUID",
"into",
"a",
"Java",
"UUID",
"instance",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1383-L1386
|
156,789
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseDurationInFractionsOfMinutes
|
private static final Duration parseDurationInFractionsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit, int factor)
{
Duration result = null;
if (value != null)
{
result = Duration.getInstance(value.intValue() / factor, TimeUnit.MINUTES);
if (targetTimeUnit != result.getUnits())
{
result = result.convertUnits(targetTimeUnit, properties);
}
}
return (result);
}
|
java
|
private static final Duration parseDurationInFractionsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit, int factor)
{
Duration result = null;
if (value != null)
{
result = Duration.getInstance(value.intValue() / factor, TimeUnit.MINUTES);
if (targetTimeUnit != result.getUnits())
{
result = result.convertUnits(targetTimeUnit, properties);
}
}
return (result);
}
|
[
"private",
"static",
"final",
"Duration",
"parseDurationInFractionsOfMinutes",
"(",
"ProjectProperties",
"properties",
",",
"Number",
"value",
",",
"TimeUnit",
"targetTimeUnit",
",",
"int",
"factor",
")",
"{",
"Duration",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"result",
"=",
"Duration",
".",
"getInstance",
"(",
"value",
".",
"intValue",
"(",
")",
"/",
"factor",
",",
"TimeUnit",
".",
"MINUTES",
")",
";",
"if",
"(",
"targetTimeUnit",
"!=",
"result",
".",
"getUnits",
"(",
")",
")",
"{",
"result",
"=",
"result",
".",
"convertUnits",
"(",
"targetTimeUnit",
",",
"properties",
")",
";",
"}",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse duration represented as an arbitrary fraction of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@param factor required fraction of a minute
@return Duration instance
|
[
"Parse",
"duration",
"represented",
"as",
"an",
"arbitrary",
"fraction",
"of",
"minutes",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1408-L1422
|
156,790
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printDurationFractionsOfMinutes
|
private static final double printDurationFractionsOfMinutes(Duration duration, int factor)
{
double result = 0;
if (duration != null)
{
result = duration.getDuration();
switch (duration.getUnits())
{
case HOURS:
case ELAPSED_HOURS:
{
result *= 60;
break;
}
case DAYS:
{
result *= (60 * 8);
break;
}
case ELAPSED_DAYS:
{
result *= (60 * 24);
break;
}
case WEEKS:
{
result *= (60 * 8 * 5);
break;
}
case ELAPSED_WEEKS:
{
result *= (60 * 24 * 7);
break;
}
case MONTHS:
{
result *= (60 * 8 * 5 * 4);
break;
}
case ELAPSED_MONTHS:
{
result *= (60 * 24 * 30);
break;
}
case YEARS:
{
result *= (60 * 8 * 5 * 52);
break;
}
case ELAPSED_YEARS:
{
result *= (60 * 24 * 365);
break;
}
default:
{
break;
}
}
}
result *= factor;
return (result);
}
|
java
|
private static final double printDurationFractionsOfMinutes(Duration duration, int factor)
{
double result = 0;
if (duration != null)
{
result = duration.getDuration();
switch (duration.getUnits())
{
case HOURS:
case ELAPSED_HOURS:
{
result *= 60;
break;
}
case DAYS:
{
result *= (60 * 8);
break;
}
case ELAPSED_DAYS:
{
result *= (60 * 24);
break;
}
case WEEKS:
{
result *= (60 * 8 * 5);
break;
}
case ELAPSED_WEEKS:
{
result *= (60 * 24 * 7);
break;
}
case MONTHS:
{
result *= (60 * 8 * 5 * 4);
break;
}
case ELAPSED_MONTHS:
{
result *= (60 * 24 * 30);
break;
}
case YEARS:
{
result *= (60 * 8 * 5 * 52);
break;
}
case ELAPSED_YEARS:
{
result *= (60 * 24 * 365);
break;
}
default:
{
break;
}
}
}
result *= factor;
return (result);
}
|
[
"private",
"static",
"final",
"double",
"printDurationFractionsOfMinutes",
"(",
"Duration",
"duration",
",",
"int",
"factor",
")",
"{",
"double",
"result",
"=",
"0",
";",
"if",
"(",
"duration",
"!=",
"null",
")",
"{",
"result",
"=",
"duration",
".",
"getDuration",
"(",
")",
";",
"switch",
"(",
"duration",
".",
"getUnits",
"(",
")",
")",
"{",
"case",
"HOURS",
":",
"case",
"ELAPSED_HOURS",
":",
"{",
"result",
"*=",
"60",
";",
"break",
";",
"}",
"case",
"DAYS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"8",
")",
";",
"break",
";",
"}",
"case",
"ELAPSED_DAYS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"24",
")",
";",
"break",
";",
"}",
"case",
"WEEKS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"8",
"*",
"5",
")",
";",
"break",
";",
"}",
"case",
"ELAPSED_WEEKS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"24",
"*",
"7",
")",
";",
"break",
";",
"}",
"case",
"MONTHS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"8",
"*",
"5",
"*",
"4",
")",
";",
"break",
";",
"}",
"case",
"ELAPSED_MONTHS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"24",
"*",
"30",
")",
";",
"break",
";",
"}",
"case",
"YEARS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"8",
"*",
"5",
"*",
"52",
")",
";",
"break",
";",
"}",
"case",
"ELAPSED_YEARS",
":",
"{",
"result",
"*=",
"(",
"60",
"*",
"24",
"*",
"365",
")",
";",
"break",
";",
"}",
"default",
":",
"{",
"break",
";",
"}",
"}",
"}",
"result",
"*=",
"factor",
";",
"return",
"(",
"result",
")",
";",
"}"
] |
Print a duration represented by an arbitrary fraction of minutes.
@param duration Duration instance
@param factor required factor
@return duration represented as an arbitrary fraction of minutes
|
[
"Print",
"a",
"duration",
"represented",
"by",
"an",
"arbitrary",
"fraction",
"of",
"minutes",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1431-L1506
|
156,791
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printRate
|
public static final BigDecimal printRate(Rate rate)
{
BigDecimal result = null;
if (rate != null && rate.getAmount() != 0)
{
result = new BigDecimal(rate.getAmount());
}
return result;
}
|
java
|
public static final BigDecimal printRate(Rate rate)
{
BigDecimal result = null;
if (rate != null && rate.getAmount() != 0)
{
result = new BigDecimal(rate.getAmount());
}
return result;
}
|
[
"public",
"static",
"final",
"BigDecimal",
"printRate",
"(",
"Rate",
"rate",
")",
"{",
"BigDecimal",
"result",
"=",
"null",
";",
"if",
"(",
"rate",
"!=",
"null",
"&&",
"rate",
".",
"getAmount",
"(",
")",
"!=",
"0",
")",
"{",
"result",
"=",
"new",
"BigDecimal",
"(",
"rate",
".",
"getAmount",
"(",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Print rate.
@param rate Rate instance
@return rate value
|
[
"Print",
"rate",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1514-L1522
|
156,792
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseRate
|
public static final Rate parseRate(BigDecimal value)
{
Rate result = null;
if (value != null)
{
result = new Rate(value, TimeUnit.HOURS);
}
return (result);
}
|
java
|
public static final Rate parseRate(BigDecimal value)
{
Rate result = null;
if (value != null)
{
result = new Rate(value, TimeUnit.HOURS);
}
return (result);
}
|
[
"public",
"static",
"final",
"Rate",
"parseRate",
"(",
"BigDecimal",
"value",
")",
"{",
"Rate",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"result",
"=",
"new",
"Rate",
"(",
"value",
",",
"TimeUnit",
".",
"HOURS",
")",
";",
"}",
"return",
"(",
"result",
")",
";",
"}"
] |
Parse rate.
@param value rate value
@return Rate instance
|
[
"Parse",
"rate",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1530-L1540
|
156,793
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printDay
|
public static final BigInteger printDay(Day day)
{
return (day == null ? null : BigInteger.valueOf(day.getValue() - 1));
}
|
java
|
public static final BigInteger printDay(Day day)
{
return (day == null ? null : BigInteger.valueOf(day.getValue() - 1));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printDay",
"(",
"Day",
"day",
")",
"{",
"return",
"(",
"day",
"==",
"null",
"?",
"null",
":",
"BigInteger",
".",
"valueOf",
"(",
"day",
".",
"getValue",
"(",
")",
"-",
"1",
")",
")",
";",
"}"
] |
Print a day.
@param day Day instance
@return day value
|
[
"Print",
"a",
"day",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1548-L1551
|
156,794
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printConstraintType
|
public static final BigInteger printConstraintType(ConstraintType value)
{
return (value == null ? null : BigInteger.valueOf(value.getValue()));
}
|
java
|
public static final BigInteger printConstraintType(ConstraintType value)
{
return (value == null ? null : BigInteger.valueOf(value.getValue()));
}
|
[
"public",
"static",
"final",
"BigInteger",
"printConstraintType",
"(",
"ConstraintType",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"BigInteger",
".",
"valueOf",
"(",
"value",
".",
"getValue",
"(",
")",
")",
")",
";",
"}"
] |
Print a constraint type.
@param value ConstraintType instance
@return constraint type value
|
[
"Print",
"a",
"constraint",
"type",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1581-L1584
|
156,795
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printTaskUID
|
public static final String printTaskUID(Integer value)
{
ProjectFile file = PARENT_FILE.get();
if (file != null)
{
file.getEventManager().fireTaskWrittenEvent(file.getTaskByUniqueID(value));
}
return (value.toString());
}
|
java
|
public static final String printTaskUID(Integer value)
{
ProjectFile file = PARENT_FILE.get();
if (file != null)
{
file.getEventManager().fireTaskWrittenEvent(file.getTaskByUniqueID(value));
}
return (value.toString());
}
|
[
"public",
"static",
"final",
"String",
"printTaskUID",
"(",
"Integer",
"value",
")",
"{",
"ProjectFile",
"file",
"=",
"PARENT_FILE",
".",
"get",
"(",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"file",
".",
"getEventManager",
"(",
")",
".",
"fireTaskWrittenEvent",
"(",
"file",
".",
"getTaskByUniqueID",
"(",
"value",
")",
")",
";",
"}",
"return",
"(",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] |
Print a task UID.
@param value task UID
@return task UID string
|
[
"Print",
"a",
"task",
"UID",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1592-L1600
|
156,796
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printResourceUID
|
public static final String printResourceUID(Integer value)
{
ProjectFile file = PARENT_FILE.get();
if (file != null)
{
file.getEventManager().fireResourceWrittenEvent(file.getResourceByUniqueID(value));
}
return (value.toString());
}
|
java
|
public static final String printResourceUID(Integer value)
{
ProjectFile file = PARENT_FILE.get();
if (file != null)
{
file.getEventManager().fireResourceWrittenEvent(file.getResourceByUniqueID(value));
}
return (value.toString());
}
|
[
"public",
"static",
"final",
"String",
"printResourceUID",
"(",
"Integer",
"value",
")",
"{",
"ProjectFile",
"file",
"=",
"PARENT_FILE",
".",
"get",
"(",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"file",
".",
"getEventManager",
"(",
")",
".",
"fireResourceWrittenEvent",
"(",
"file",
".",
"getResourceByUniqueID",
"(",
"value",
")",
")",
";",
"}",
"return",
"(",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] |
Print a resource UID.
@param value resource UID value
@return resource UID string
|
[
"Print",
"a",
"resource",
"UID",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1619-L1627
|
156,797
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.parseBoolean
|
public static final Boolean parseBoolean(String value)
{
return (value == null || value.charAt(0) != '1' ? Boolean.FALSE : Boolean.TRUE);
}
|
java
|
public static final Boolean parseBoolean(String value)
{
return (value == null || value.charAt(0) != '1' ? Boolean.FALSE : Boolean.TRUE);
}
|
[
"public",
"static",
"final",
"Boolean",
"parseBoolean",
"(",
"String",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"charAt",
"(",
"0",
")",
"!=",
"'",
"'",
"?",
"Boolean",
".",
"FALSE",
":",
"Boolean",
".",
"TRUE",
")",
";",
"}"
] |
Parse a boolean.
@param value boolean
@return Boolean value
|
[
"Parse",
"a",
"boolean",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1657-L1660
|
156,798
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.printDateTime
|
public static final String printDateTime(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
}
|
java
|
public static final String printDateTime(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
}
|
[
"public",
"static",
"final",
"String",
"printDateTime",
"(",
"Date",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"DATE_FORMAT",
".",
"get",
"(",
")",
".",
"format",
"(",
"value",
")",
")",
";",
"}"
] |
Print a date time value.
@param value date time value
@return string representation
|
[
"Print",
"a",
"date",
"time",
"value",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1692-L1695
|
156,799
|
joniles/mpxj
|
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
|
DatatypeConverter.correctNumberFormat
|
private static final String correctNumberFormat(String value)
{
String result;
int index = value.indexOf(',');
if (index == -1)
{
result = value;
}
else
{
char[] chars = value.toCharArray();
chars[index] = '.';
result = new String(chars);
}
return result;
}
|
java
|
private static final String correctNumberFormat(String value)
{
String result;
int index = value.indexOf(',');
if (index == -1)
{
result = value;
}
else
{
char[] chars = value.toCharArray();
chars[index] = '.';
result = new String(chars);
}
return result;
}
|
[
"private",
"static",
"final",
"String",
"correctNumberFormat",
"(",
"String",
"value",
")",
"{",
"String",
"result",
";",
"int",
"index",
"=",
"value",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"result",
"=",
"value",
";",
"}",
"else",
"{",
"char",
"[",
"]",
"chars",
"=",
"value",
".",
"toCharArray",
"(",
")",
";",
"chars",
"[",
"index",
"]",
"=",
"'",
"'",
";",
"result",
"=",
"new",
"String",
"(",
"chars",
")",
";",
"}",
"return",
"result",
";",
"}"
] |
Detect numbers using comma as a decimal separator and replace with period.
@param value original numeric value
@return corrected numeric value
|
[
"Detect",
"numbers",
"using",
"comma",
"as",
"a",
"decimal",
"separator",
"and",
"replace",
"with",
"period",
"."
] |
143ea0e195da59cd108f13b3b06328e9542337e8
|
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1767-L1782
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.