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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTableHeader | private SynchroTable readTableHeader(byte[] header)
{
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
int offset = DatatypeConverter.getInt(header, 40);
result = new SynchroTable(tableName, offset);
... | java | private SynchroTable readTableHeader(byte[] header)
{
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
int offset = DatatypeConverter.getInt(header, 40);
result = new SynchroTable(tableName, offset);
... | [
"private",
"SynchroTable",
"readTableHeader",
"(",
"byte",
"[",
"]",
"header",
")",
"{",
"SynchroTable",
"result",
"=",
"null",
";",
"String",
"tableName",
"=",
"DatatypeConverter",
".",
"getSimpleString",
"(",
"header",
",",
"0",
")",
";",
"if",
"(",
"!",
... | Read the header data for a single file.
@param header header data
@return SynchroTable instance | [
"Read",
"the",
"header",
"data",
"for",
"a",
"single",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L140-L150 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTableData | private void readTableData(List<SynchroTable> tables, InputStream is) throws IOException
{
for (SynchroTable table : tables)
{
if (REQUIRED_TABLES.contains(table.getName()))
{
readTable(is, table);
}
}
} | java | private void readTableData(List<SynchroTable> tables, InputStream is) throws IOException
{
for (SynchroTable table : tables)
{
if (REQUIRED_TABLES.contains(table.getName()))
{
readTable(is, table);
}
}
} | [
"private",
"void",
"readTableData",
"(",
"List",
"<",
"SynchroTable",
">",
"tables",
",",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"for",
"(",
"SynchroTable",
"table",
":",
"tables",
")",
"{",
"if",
"(",
"REQUIRED_TABLES",
".",
"contains",
"("... | Read the data for all of the tables we're interested in.
@param tables list of all available tables
@param is input stream | [
"Read",
"the",
"data",
"for",
"all",
"of",
"the",
"tables",
"we",
"re",
"interested",
"in",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L158-L167 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTable | private void readTable(InputStream is, SynchroTable table) throws IOException
{
int skip = table.getOffset() - m_offset;
if (skip != 0)
{
StreamHelper.skip(is, skip);
m_offset += skip;
}
String tableName = DatatypeConverter.getString(is);
int tableNameLength = 2... | java | private void readTable(InputStream is, SynchroTable table) throws IOException
{
int skip = table.getOffset() - m_offset;
if (skip != 0)
{
StreamHelper.skip(is, skip);
m_offset += skip;
}
String tableName = DatatypeConverter.getString(is);
int tableNameLength = 2... | [
"private",
"void",
"readTable",
"(",
"InputStream",
"is",
",",
"SynchroTable",
"table",
")",
"throws",
"IOException",
"{",
"int",
"skip",
"=",
"table",
".",
"getOffset",
"(",
")",
"-",
"m_offset",
";",
"if",
"(",
"skip",
"!=",
"0",
")",
"{",
"StreamHelpe... | Read data for a single table and store it.
@param is input stream
@param table table header | [
"Read",
"data",
"for",
"a",
"single",
"table",
"and",
"store",
"it",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L175-L228 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readHeader | private void readHeader(InputStream is) throws IOException
{
byte[] header = new byte[20];
is.read(header);
m_offset += 20;
SynchroLogger.log("HEADER", header);
} | java | private void readHeader(InputStream is) throws IOException
{
byte[] header = new byte[20];
is.read(header);
m_offset += 20;
SynchroLogger.log("HEADER", header);
} | [
"private",
"void",
"readHeader",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"header",
"=",
"new",
"byte",
"[",
"20",
"]",
";",
"is",
".",
"read",
"(",
"header",
")",
";",
"m_offset",
"+=",
"20",
";",
"SynchroLogger",... | Read the file header data.
@param is input stream | [
"Read",
"the",
"file",
"header",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L235-L241 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readVersion | private void readVersion(InputStream is) throws IOException
{
BytesReadInputStream bytesReadStream = new BytesReadInputStream(is);
String version = DatatypeConverter.getString(bytesReadStream);
m_offset += bytesReadStream.getBytesRead();
SynchroLogger.log("VERSION", version);
Str... | java | private void readVersion(InputStream is) throws IOException
{
BytesReadInputStream bytesReadStream = new BytesReadInputStream(is);
String version = DatatypeConverter.getString(bytesReadStream);
m_offset += bytesReadStream.getBytesRead();
SynchroLogger.log("VERSION", version);
Str... | [
"private",
"void",
"readVersion",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"BytesReadInputStream",
"bytesReadStream",
"=",
"new",
"BytesReadInputStream",
"(",
"is",
")",
";",
"String",
"version",
"=",
"DatatypeConverter",
".",
"getString",
"(",
... | Read the version number.
@param is input stream | [
"Read",
"the",
"version",
"number",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L248-L257 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java | PrimaveraDatabaseReader.readAll | public List<ProjectFile> readAll() throws MPXJException
{
Map<Integer, String> projects = listProjects();
List<ProjectFile> result = new ArrayList<ProjectFile>(projects.keySet().size());
for (Integer id : projects.keySet())
{
setProjectID(id.intValue());
result.add(read());
... | java | public List<ProjectFile> readAll() throws MPXJException
{
Map<Integer, String> projects = listProjects();
List<ProjectFile> result = new ArrayList<ProjectFile>(projects.keySet().size());
for (Integer id : projects.keySet())
{
setProjectID(id.intValue());
result.add(read());
... | [
"public",
"List",
"<",
"ProjectFile",
">",
"readAll",
"(",
")",
"throws",
"MPXJException",
"{",
"Map",
"<",
"Integer",
",",
"String",
">",
"projects",
"=",
"listProjects",
"(",
")",
";",
"List",
"<",
"ProjectFile",
">",
"result",
"=",
"new",
"ArrayList",
... | Convenience method which allows all projects in the database to
be read in a single operation.
@return list of ProjectFile instances
@throws MPXJException | [
"Convenience",
"method",
"which",
"allows",
"all",
"projects",
"in",
"the",
"database",
"to",
"be",
"read",
"in",
"a",
"single",
"operation",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java#L161-L171 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java | PrimaveraDatabaseReader.processAnalytics | private void processAnalytics() throws SQLException
{
allocateConnection();
try
{
DatabaseMetaData meta = m_connection.getMetaData();
String productName = meta.getDatabaseProductName();
if (productName == null || productName.isEmpty())
{
productName ... | java | private void processAnalytics() throws SQLException
{
allocateConnection();
try
{
DatabaseMetaData meta = m_connection.getMetaData();
String productName = meta.getDatabaseProductName();
if (productName == null || productName.isEmpty())
{
productName ... | [
"private",
"void",
"processAnalytics",
"(",
")",
"throws",
"SQLException",
"{",
"allocateConnection",
"(",
")",
";",
"try",
"{",
"DatabaseMetaData",
"meta",
"=",
"m_connection",
".",
"getMetaData",
"(",
")",
";",
"String",
"productName",
"=",
"meta",
".",
"get... | Populate data for analytics. | [
"Populate",
"data",
"for",
"analytics",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java#L176-L202 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java | PrimaveraDatabaseReader.processSchedulingProjectProperties | private void processSchedulingProjectProperties() throws SQLException
{
List<Row> rows = getRows("select * from " + m_schema + "projprop where proj_id=? and prop_name='scheduling'", m_projectID);
if (!rows.isEmpty())
{
Row row = rows.get(0);
Record record = Record.getRecord(row.ge... | java | private void processSchedulingProjectProperties() throws SQLException
{
List<Row> rows = getRows("select * from " + m_schema + "projprop where proj_id=? and prop_name='scheduling'", m_projectID);
if (!rows.isEmpty())
{
Row row = rows.get(0);
Record record = Record.getRecord(row.ge... | [
"private",
"void",
"processSchedulingProjectProperties",
"(",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"Row",
">",
"rows",
"=",
"getRows",
"(",
"\"select * from \"",
"+",
"m_schema",
"+",
"\"projprop where proj_id=? and prop_name='scheduling'\"",
",",
"m_projectID... | Process the scheduling project property from PROJPROP. This table only seems to exist
in P6 databases, not XER files.
@throws SQLException | [
"Process",
"the",
"scheduling",
"project",
"property",
"from",
"PROJPROP",
".",
"This",
"table",
"only",
"seems",
"to",
"exist",
"in",
"P6",
"databases",
"not",
"XER",
"files",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java#L264-L286 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java | PrimaveraDatabaseReader.processDefaultCurrency | private void processDefaultCurrency(Integer currencyID) throws SQLException
{
List<Row> rows = getRows("select * from " + m_schema + "currtype where curr_id=?", currencyID);
if (!rows.isEmpty())
{
Row row = rows.get(0);
m_reader.processDefaultCurrency(row);
}
} | java | private void processDefaultCurrency(Integer currencyID) throws SQLException
{
List<Row> rows = getRows("select * from " + m_schema + "currtype where curr_id=?", currencyID);
if (!rows.isEmpty())
{
Row row = rows.get(0);
m_reader.processDefaultCurrency(row);
}
} | [
"private",
"void",
"processDefaultCurrency",
"(",
"Integer",
"currencyID",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"Row",
">",
"rows",
"=",
"getRows",
"(",
"\"select * from \"",
"+",
"m_schema",
"+",
"\"currtype where curr_id=?\"",
",",
"currencyID",
")",
... | Select the default currency properties from the database.
@param currencyID default currency ID | [
"Select",
"the",
"default",
"currency",
"properties",
"from",
"the",
"database",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java#L293-L301 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java | PrimaveraDatabaseReader.setSchema | public void setSchema(String schema)
{
if (schema == null)
{
schema = "";
}
else
{
if (!schema.isEmpty() && !schema.endsWith("."))
{
schema = schema + '.';
}
}
m_schema = schema;
} | java | public void setSchema(String schema)
{
if (schema == null)
{
schema = "";
}
else
{
if (!schema.isEmpty() && !schema.endsWith("."))
{
schema = schema + '.';
}
}
m_schema = schema;
} | [
"public",
"void",
"setSchema",
"(",
"String",
"schema",
")",
"{",
"if",
"(",
"schema",
"==",
"null",
")",
"{",
"schema",
"=",
"\"\"",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"schema",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"schema",
".",
"endsWith",
... | Set the name of the schema containing the Primavera tables.
@param schema schema name. | [
"Set",
"the",
"name",
"of",
"the",
"schema",
"containing",
"the",
"Primavera",
"tables",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraDatabaseReader.java#L568-L582 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXJNumberFormat.java | MPXJNumberFormat.applyPattern | public void applyPattern(String primaryPattern, String[] alternativePatterns, char decimalSeparator, char groupingSeparator)
{
m_symbols.setDecimalSeparator(decimalSeparator);
m_symbols.setGroupingSeparator(groupingSeparator);
setDecimalFormatSymbols(m_symbols);
applyPattern(primaryPattern);... | java | public void applyPattern(String primaryPattern, String[] alternativePatterns, char decimalSeparator, char groupingSeparator)
{
m_symbols.setDecimalSeparator(decimalSeparator);
m_symbols.setGroupingSeparator(groupingSeparator);
setDecimalFormatSymbols(m_symbols);
applyPattern(primaryPattern);... | [
"public",
"void",
"applyPattern",
"(",
"String",
"primaryPattern",
",",
"String",
"[",
"]",
"alternativePatterns",
",",
"char",
"decimalSeparator",
",",
"char",
"groupingSeparator",
")",
"{",
"m_symbols",
".",
"setDecimalSeparator",
"(",
"decimalSeparator",
")",
";"... | This method is used to configure the primary and alternative
format patterns.
@param primaryPattern new format pattern
@param alternativePatterns alternative format patterns
@param decimalSeparator Locale specific decimal separator to replace placeholder
@param groupingSeparator Locale specific grouping separator to r... | [
"This",
"method",
"is",
"used",
"to",
"configure",
"the",
"primary",
"and",
"alternative",
"format",
"patterns",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXJNumberFormat.java#L47-L73 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/ResourceModel.java | ResourceModel.getResourceField | private String getResourceField(int key)
{
String result = null;
if (key > 0 && key < m_resourceNames.length)
{
result = m_resourceNames[key];
}
return (result);
} | java | private String getResourceField(int key)
{
String result = null;
if (key > 0 && key < m_resourceNames.length)
{
result = m_resourceNames[key];
}
return (result);
} | [
"private",
"String",
"getResourceField",
"(",
"int",
"key",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"key",
">",
"0",
"&&",
"key",
"<",
"m_resourceNames",
".",
"length",
")",
"{",
"result",
"=",
"m_resourceNames",
"[",
"key",
"]",
";"... | Given a resource field number, this method returns the resource field name.
@param key resource field number
@return resource field name | [
"Given",
"a",
"resource",
"field",
"number",
"this",
"method",
"returns",
"the",
"resource",
"field",
"name",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/ResourceModel.java#L213-L223 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/ResourceModel.java | ResourceModel.getResourceCode | private int getResourceCode(String field) throws MPXJException
{
Integer result = m_resourceNumbers.get(field);
if (result == null)
{
throw new MPXJException(MPXJException.INVALID_RESOURCE_FIELD_NAME + " " + field);
}
return (result.intValue());
} | java | private int getResourceCode(String field) throws MPXJException
{
Integer result = m_resourceNumbers.get(field);
if (result == null)
{
throw new MPXJException(MPXJException.INVALID_RESOURCE_FIELD_NAME + " " + field);
}
return (result.intValue());
} | [
"private",
"int",
"getResourceCode",
"(",
"String",
"field",
")",
"throws",
"MPXJException",
"{",
"Integer",
"result",
"=",
"m_resourceNumbers",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"MPXJException",... | Given a resource field name, this method returns the resource field number.
@param field resource field name
@return resource field number | [
"Given",
"a",
"resource",
"field",
"name",
"this",
"method",
"returns",
"the",
"resource",
"field",
"number",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/ResourceModel.java#L231-L241 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttproject/CustomProperty.java | CustomProperty.getField | public FieldType getField()
{
FieldType result = null;
if (m_index < m_fields.length)
{
result = m_fields[m_index++];
}
return result;
} | java | public FieldType getField()
{
FieldType result = null;
if (m_index < m_fields.length)
{
result = m_fields[m_index++];
}
return result;
} | [
"public",
"FieldType",
"getField",
"(",
")",
"{",
"FieldType",
"result",
"=",
"null",
";",
"if",
"(",
"m_index",
"<",
"m_fields",
".",
"length",
")",
"{",
"result",
"=",
"m_fields",
"[",
"m_index",
"++",
"]",
";",
"}",
"return",
"result",
";",
"}"
] | Retrieve the next available field.
@return FieldType instance for the next available field | [
"Retrieve",
"the",
"next",
"available",
"field",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttproject/CustomProperty.java#L61-L70 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readTable | public List<MapRow> readTable(TableReader reader) throws IOException
{
reader.read();
return reader.getRows();
} | java | public List<MapRow> readTable(TableReader reader) throws IOException
{
reader.read();
return reader.getRows();
} | [
"public",
"List",
"<",
"MapRow",
">",
"readTable",
"(",
"TableReader",
"reader",
")",
"throws",
"IOException",
"{",
"reader",
".",
"read",
"(",
")",
";",
"return",
"reader",
".",
"getRows",
"(",
")",
";",
"}"
] | Read a nested table. Instantiates the supplied reader class to
extract the data.
@param reader table reader class
@return table rows | [
"Read",
"a",
"nested",
"table",
".",
"Instantiates",
"the",
"supplied",
"reader",
"class",
"to",
"extract",
"the",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L80-L84 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readUnknownTable | public List<MapRow> readUnknownTable(int rowSize, int rowMagicNumber) throws IOException
{
TableReader reader = new UnknownTableReader(this, rowSize, rowMagicNumber);
reader.read();
return reader.getRows();
} | java | public List<MapRow> readUnknownTable(int rowSize, int rowMagicNumber) throws IOException
{
TableReader reader = new UnknownTableReader(this, rowSize, rowMagicNumber);
reader.read();
return reader.getRows();
} | [
"public",
"List",
"<",
"MapRow",
">",
"readUnknownTable",
"(",
"int",
"rowSize",
",",
"int",
"rowMagicNumber",
")",
"throws",
"IOException",
"{",
"TableReader",
"reader",
"=",
"new",
"UnknownTableReader",
"(",
"this",
",",
"rowSize",
",",
"rowMagicNumber",
")",
... | Read a nested table whose contents we don't understand.
@param rowSize fixed row size
@param rowMagicNumber row magic number
@return table rows | [
"Read",
"a",
"nested",
"table",
"whose",
"contents",
"we",
"don",
"t",
"understand",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L93-L98 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readTable | public List<MapRow> readTable(Class<? extends TableReader> readerClass) throws IOException
{
TableReader reader;
try
{
reader = readerClass.getConstructor(StreamReader.class).newInstance(this);
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
... | java | public List<MapRow> readTable(Class<? extends TableReader> readerClass) throws IOException
{
TableReader reader;
try
{
reader = readerClass.getConstructor(StreamReader.class).newInstance(this);
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
... | [
"public",
"List",
"<",
"MapRow",
">",
"readTable",
"(",
"Class",
"<",
"?",
"extends",
"TableReader",
">",
"readerClass",
")",
"throws",
"IOException",
"{",
"TableReader",
"reader",
";",
"try",
"{",
"reader",
"=",
"readerClass",
".",
"getConstructor",
"(",
"S... | Reads a nested table. Uses the supplied reader class instance.
@param readerClass reader class instance
@return table rows | [
"Reads",
"a",
"nested",
"table",
".",
"Uses",
"the",
"supplied",
"reader",
"class",
"instance",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L106-L120 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readTableConditional | public List<MapRow> readTableConditional(Class<? extends TableReader> readerClass) throws IOException
{
List<MapRow> result;
if (DatatypeConverter.getBoolean(m_stream))
{
result = readTable(readerClass);
}
else
{
result = Collections.emptyList();
}
re... | java | public List<MapRow> readTableConditional(Class<? extends TableReader> readerClass) throws IOException
{
List<MapRow> result;
if (DatatypeConverter.getBoolean(m_stream))
{
result = readTable(readerClass);
}
else
{
result = Collections.emptyList();
}
re... | [
"public",
"List",
"<",
"MapRow",
">",
"readTableConditional",
"(",
"Class",
"<",
"?",
"extends",
"TableReader",
">",
"readerClass",
")",
"throws",
"IOException",
"{",
"List",
"<",
"MapRow",
">",
"result",
";",
"if",
"(",
"DatatypeConverter",
".",
"getBoolean",... | Conditionally read a nested table based in the value of a boolean flag which precedes the table data.
@param readerClass reader class
@return table rows or empty list if table not present | [
"Conditionally",
"read",
"a",
"nested",
"table",
"based",
"in",
"the",
"value",
"of",
"a",
"boolean",
"flag",
"which",
"precedes",
"the",
"table",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L128-L140 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readBytes | public ByteArray readBytes(int size) throws IOException
{
byte[] data = new byte[size];
m_stream.read(data);
return new ByteArray(data);
} | java | public ByteArray readBytes(int size) throws IOException
{
byte[] data = new byte[size];
m_stream.read(data);
return new ByteArray(data);
} | [
"public",
"ByteArray",
"readBytes",
"(",
"int",
"size",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"size",
"]",
";",
"m_stream",
".",
"read",
"(",
"data",
")",
";",
"return",
"new",
"ByteArray",
"(",
"data",
... | Read an array of bytes of a specified size.
@param size number of bytes to read
@return ByteArray instance | [
"Read",
"an",
"array",
"of",
"bytes",
"of",
"a",
"specified",
"size",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L148-L153 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/StreamReader.java | StreamReader.readBlocks | public List<MapRow> readBlocks(Class<? extends BlockReader> readerClass) throws IOException
{
BlockReader reader;
try
{
reader = readerClass.getConstructor(StreamReader.class).newInstance(this);
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
... | java | public List<MapRow> readBlocks(Class<? extends BlockReader> readerClass) throws IOException
{
BlockReader reader;
try
{
reader = readerClass.getConstructor(StreamReader.class).newInstance(this);
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
... | [
"public",
"List",
"<",
"MapRow",
">",
"readBlocks",
"(",
"Class",
"<",
"?",
"extends",
"BlockReader",
">",
"readerClass",
")",
"throws",
"IOException",
"{",
"BlockReader",
"reader",
";",
"try",
"{",
"reader",
"=",
"readerClass",
".",
"getConstructor",
"(",
"... | Read a list of fixed size blocks using an instance of the supplied reader class.
@param readerClass reader class
@return list of blocks | [
"Read",
"a",
"list",
"of",
"fixed",
"size",
"blocks",
"using",
"an",
"instance",
"of",
"the",
"supplied",
"reader",
"class",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/StreamReader.java#L252-L266 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readFile | private void readFile(InputStream is) throws IOException
{
StreamHelper.skip(is, 64);
int index = 64;
ArrayList<Integer> offsetList = new ArrayList<Integer>();
List<String> nameList = new ArrayList<String>();
while (true)
{
byte[] table = new byte[32];
is.read(... | java | private void readFile(InputStream is) throws IOException
{
StreamHelper.skip(is, 64);
int index = 64;
ArrayList<Integer> offsetList = new ArrayList<Integer>();
List<String> nameList = new ArrayList<String>();
while (true)
{
byte[] table = new byte[32];
is.read(... | [
"private",
"void",
"readFile",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"StreamHelper",
".",
"skip",
"(",
"is",
",",
"64",
")",
";",
"int",
"index",
"=",
"64",
";",
"ArrayList",
"<",
"Integer",
">",
"offsetList",
"=",
"new",
"ArrayLis... | Reads a PEP file from the input stream.
@param is input stream representing a PEP file | [
"Reads",
"a",
"PEP",
"file",
"from",
"the",
"input",
"stream",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L138-L187 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readCalendars | private void readCalendars()
{
//
// Create the calendars
//
for (MapRow row : getTable("NCALTAB"))
{
ProjectCalendar calendar = m_projectFile.addCalendar();
calendar.setUniqueID(row.getInteger("UNIQUE_ID"));
calendar.setName(row.getString("NAME"));
c... | java | private void readCalendars()
{
//
// Create the calendars
//
for (MapRow row : getTable("NCALTAB"))
{
ProjectCalendar calendar = m_projectFile.addCalendar();
calendar.setUniqueID(row.getInteger("UNIQUE_ID"));
calendar.setName(row.getString("NAME"));
c... | [
"private",
"void",
"readCalendars",
"(",
")",
"{",
"//",
"// Create the calendars",
"//",
"for",
"(",
"MapRow",
"row",
":",
"getTable",
"(",
"\"NCALTAB\"",
")",
")",
"{",
"ProjectCalendar",
"calendar",
"=",
"m_projectFile",
".",
"addCalendar",
"(",
")",
";",
... | Read calendar data from a PEP file. | [
"Read",
"calendar",
"data",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L192-L237 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.addCalendarExceptions | private void addCalendarExceptions(Table table, ProjectCalendar calendar, Integer exceptionID)
{
Integer currentExceptionID = exceptionID;
while (true)
{
MapRow row = table.find(currentExceptionID);
if (row == null)
{
break;
}
Date date = ro... | java | private void addCalendarExceptions(Table table, ProjectCalendar calendar, Integer exceptionID)
{
Integer currentExceptionID = exceptionID;
while (true)
{
MapRow row = table.find(currentExceptionID);
if (row == null)
{
break;
}
Date date = ro... | [
"private",
"void",
"addCalendarExceptions",
"(",
"Table",
"table",
",",
"ProjectCalendar",
"calendar",
",",
"Integer",
"exceptionID",
")",
"{",
"Integer",
"currentExceptionID",
"=",
"exceptionID",
";",
"while",
"(",
"true",
")",
"{",
"MapRow",
"row",
"=",
"table... | Read exceptions for a calendar.
@param table calendar exception data
@param calendar calendar
@param exceptionID first exception ID | [
"Read",
"exceptions",
"for",
"a",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L246-L267 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readResources | private void readResources()
{
for (MapRow row : getTable("RTAB"))
{
Resource resource = m_projectFile.addResource();
setFields(RESOURCE_FIELDS, row, resource);
m_eventManager.fireResourceReadEvent(resource);
// TODO: Correctly handle calendar
}
} | java | private void readResources()
{
for (MapRow row : getTable("RTAB"))
{
Resource resource = m_projectFile.addResource();
setFields(RESOURCE_FIELDS, row, resource);
m_eventManager.fireResourceReadEvent(resource);
// TODO: Correctly handle calendar
}
} | [
"private",
"void",
"readResources",
"(",
")",
"{",
"for",
"(",
"MapRow",
"row",
":",
"getTable",
"(",
"\"RTAB\"",
")",
")",
"{",
"Resource",
"resource",
"=",
"m_projectFile",
".",
"addResource",
"(",
")",
";",
"setFields",
"(",
"RESOURCE_FIELDS",
",",
"row... | Read resource data from a PEP file. | [
"Read",
"resource",
"data",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L272-L281 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readTasks | private void readTasks()
{
Integer rootID = Integer.valueOf(1);
readWBS(m_projectFile, rootID);
readTasks(rootID);
m_projectFile.getTasks().synchronizeTaskIDToHierarchy();
} | java | private void readTasks()
{
Integer rootID = Integer.valueOf(1);
readWBS(m_projectFile, rootID);
readTasks(rootID);
m_projectFile.getTasks().synchronizeTaskIDToHierarchy();
} | [
"private",
"void",
"readTasks",
"(",
")",
"{",
"Integer",
"rootID",
"=",
"Integer",
".",
"valueOf",
"(",
"1",
")",
";",
"readWBS",
"(",
"m_projectFile",
",",
"rootID",
")",
";",
"readTasks",
"(",
"rootID",
")",
";",
"m_projectFile",
".",
"getTasks",
"(",... | Read task data from a PEP file. | [
"Read",
"task",
"data",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L286-L292 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readWBS | private void readWBS(ChildTaskContainer parent, Integer id)
{
Integer currentID = id;
Table table = getTable("WBSTAB");
while (currentID.intValue() != 0)
{
MapRow row = table.find(currentID);
Integer taskID = row.getInteger("TASK_ID");
Task task = readTask(parent, ... | java | private void readWBS(ChildTaskContainer parent, Integer id)
{
Integer currentID = id;
Table table = getTable("WBSTAB");
while (currentID.intValue() != 0)
{
MapRow row = table.find(currentID);
Integer taskID = row.getInteger("TASK_ID");
Task task = readTask(parent, ... | [
"private",
"void",
"readWBS",
"(",
"ChildTaskContainer",
"parent",
",",
"Integer",
"id",
")",
"{",
"Integer",
"currentID",
"=",
"id",
";",
"Table",
"table",
"=",
"getTable",
"(",
"\"WBSTAB\"",
")",
";",
"while",
"(",
"currentID",
".",
"intValue",
"(",
")",... | Recursively read the WBS structure from a PEP file.
@param parent parent container for tasks
@param id initial WBS ID | [
"Recursively",
"read",
"the",
"WBS",
"structure",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L300-L317 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readTasks | private void readTasks(Integer id)
{
Integer currentID = id;
Table table = getTable("WBSTAB");
while (currentID.intValue() != 0)
{
MapRow row = table.find(currentID);
Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
readLeafTasks(task, row.ge... | java | private void readTasks(Integer id)
{
Integer currentID = id;
Table table = getTable("WBSTAB");
while (currentID.intValue() != 0)
{
MapRow row = table.find(currentID);
Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
readLeafTasks(task, row.ge... | [
"private",
"void",
"readTasks",
"(",
"Integer",
"id",
")",
"{",
"Integer",
"currentID",
"=",
"id",
";",
"Table",
"table",
"=",
"getTable",
"(",
"\"WBSTAB\"",
")",
";",
"while",
"(",
"currentID",
".",
"intValue",
"(",
")",
"!=",
"0",
")",
"{",
"MapRow",... | Read leaf tasks attached to the WBS.
@param id initial WBS ID | [
"Read",
"leaf",
"tasks",
"attached",
"to",
"the",
"WBS",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L324-L341 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readLeafTasks | private void readLeafTasks(Task parent, Integer id)
{
Integer currentID = id;
Table table = getTable("A1TAB");
while (currentID.intValue() != 0)
{
if (m_projectFile.getTaskByUniqueID(currentID) == null)
{
readTask(parent, currentID);
}
currentID... | java | private void readLeafTasks(Task parent, Integer id)
{
Integer currentID = id;
Table table = getTable("A1TAB");
while (currentID.intValue() != 0)
{
if (m_projectFile.getTaskByUniqueID(currentID) == null)
{
readTask(parent, currentID);
}
currentID... | [
"private",
"void",
"readLeafTasks",
"(",
"Task",
"parent",
",",
"Integer",
"id",
")",
"{",
"Integer",
"currentID",
"=",
"id",
";",
"Table",
"table",
"=",
"getTable",
"(",
"\"A1TAB\"",
")",
";",
"while",
"(",
"currentID",
".",
"intValue",
"(",
")",
"!=",
... | Read the leaf tasks for an individual WBS node.
@param parent parent task
@param id first task ID | [
"Read",
"the",
"leaf",
"tasks",
"for",
"an",
"individual",
"WBS",
"node",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L349-L361 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readTask | private Task readTask(ChildTaskContainer parent, Integer id)
{
Table a0 = getTable("A0TAB");
Table a1 = getTable("A1TAB");
Table a2 = getTable("A2TAB");
Table a3 = getTable("A3TAB");
Table a4 = getTable("A4TAB");
Task task = parent.addTask();
MapRow a1Row = a1.find(id);
... | java | private Task readTask(ChildTaskContainer parent, Integer id)
{
Table a0 = getTable("A0TAB");
Table a1 = getTable("A1TAB");
Table a2 = getTable("A2TAB");
Table a3 = getTable("A3TAB");
Table a4 = getTable("A4TAB");
Task task = parent.addTask();
MapRow a1Row = a1.find(id);
... | [
"private",
"Task",
"readTask",
"(",
"ChildTaskContainer",
"parent",
",",
"Integer",
"id",
")",
"{",
"Table",
"a0",
"=",
"getTable",
"(",
"\"A0TAB\"",
")",
";",
"Table",
"a1",
"=",
"getTable",
"(",
"\"A1TAB\"",
")",
";",
"Table",
"a2",
"=",
"getTable",
"(... | Read data for an individual task from the tables in a PEP file.
@param parent parent task
@param id task ID
@return task instance | [
"Read",
"data",
"for",
"an",
"individual",
"task",
"from",
"the",
"tables",
"in",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L370-L398 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readRelationships | private void readRelationships()
{
for (MapRow row : getTable("CONTAB"))
{
Task task1 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_1"));
Task task2 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_2"));
if (task1 != null && task2 != null)
{
... | java | private void readRelationships()
{
for (MapRow row : getTable("CONTAB"))
{
Task task1 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_1"));
Task task2 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_2"));
if (task1 != null && task2 != null)
{
... | [
"private",
"void",
"readRelationships",
"(",
")",
"{",
"for",
"(",
"MapRow",
"row",
":",
"getTable",
"(",
"\"CONTAB\"",
")",
")",
"{",
"Task",
"task1",
"=",
"m_projectFile",
".",
"getTaskByUniqueID",
"(",
"row",
".",
"getInteger",
"(",
"\"TASK_ID_1\"",
")",
... | Read relationship data from a PEP file. | [
"Read",
"relationship",
"data",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L403-L418 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.readResourceAssignments | private void readResourceAssignments()
{
for (MapRow row : getTable("USGTAB"))
{
Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
Resource resource = m_projectFile.getResourceByUniqueID(row.getInteger("RESOURCE_ID"));
if (task != null && resource != null)... | java | private void readResourceAssignments()
{
for (MapRow row : getTable("USGTAB"))
{
Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
Resource resource = m_projectFile.getResourceByUniqueID(row.getInteger("RESOURCE_ID"));
if (task != null && resource != null)... | [
"private",
"void",
"readResourceAssignments",
"(",
")",
"{",
"for",
"(",
"MapRow",
"row",
":",
"getTable",
"(",
"\"USGTAB\"",
")",
")",
"{",
"Task",
"task",
"=",
"m_projectFile",
".",
"getTaskByUniqueID",
"(",
"row",
".",
"getInteger",
"(",
"\"TASK_ID\"",
")... | Read resource assignment data from a PEP file. | [
"Read",
"resource",
"assignment",
"data",
"from",
"a",
"PEP",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L423-L435 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.getTable | private Table getTable(String name)
{
Table table = m_tables.get(name);
if (table == null)
{
table = EMPTY_TABLE;
}
return table;
} | java | private Table getTable(String name)
{
Table table = m_tables.get(name);
if (table == null)
{
table = EMPTY_TABLE;
}
return table;
} | [
"private",
"Table",
"getTable",
"(",
"String",
"name",
")",
"{",
"Table",
"table",
"=",
"m_tables",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"table",
"==",
"null",
")",
"{",
"table",
"=",
"EMPTY_TABLE",
";",
"}",
"return",
"table",
";",
"}"
] | Retrieve a table by name.
@param name table name
@return Table instance | [
"Retrieve",
"a",
"table",
"by",
"name",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L443-L451 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.applyAliases | private void applyAliases()
{
CustomFieldContainer fields = m_projectFile.getCustomFields();
for (Map.Entry<FieldType, String> entry : ALIASES.entrySet())
{
fields.getCustomField(entry.getKey()).setAlias(entry.getValue());
}
} | java | private void applyAliases()
{
CustomFieldContainer fields = m_projectFile.getCustomFields();
for (Map.Entry<FieldType, String> entry : ALIASES.entrySet())
{
fields.getCustomField(entry.getKey()).setAlias(entry.getValue());
}
} | [
"private",
"void",
"applyAliases",
"(",
")",
"{",
"CustomFieldContainer",
"fields",
"=",
"m_projectFile",
".",
"getCustomFields",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"FieldType",
",",
"String",
">",
"entry",
":",
"ALIASES",
".",
"entrySet",
... | Configure column aliases. | [
"Configure",
"column",
"aliases",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L456-L463 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.defineField | private static void defineField(Map<String, FieldType> container, String name, FieldType type, String alias)
{
container.put(name, type);
if (alias != null)
{
ALIASES.put(type, alias);
}
} | java | private static void defineField(Map<String, FieldType> container, String name, FieldType type, String alias)
{
container.put(name, type);
if (alias != null)
{
ALIASES.put(type, alias);
}
} | [
"private",
"static",
"void",
"defineField",
"(",
"Map",
"<",
"String",
",",
"FieldType",
">",
"container",
",",
"String",
"name",
",",
"FieldType",
"type",
",",
"String",
"alias",
")",
"{",
"container",
".",
"put",
"(",
"name",
",",
"type",
")",
";",
"... | Configure the mapping between a database column and a field, including definition of
an alias.
@param container column to field map
@param name column name
@param type field type
@param alias field alias | [
"Configure",
"the",
"mapping",
"between",
"a",
"database",
"column",
"and",
"a",
"field",
"including",
"definition",
"of",
"an",
"alias",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L504-L511 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/ExtendedData.java | ExtendedData.getString | public String getString(Integer type)
{
String result = null;
byte[] item = m_map.get(type);
if (item != null)
{
result = m_data.getString(getOffset(item));
}
return (result);
} | java | public String getString(Integer type)
{
String result = null;
byte[] item = m_map.get(type);
if (item != null)
{
result = m_data.getString(getOffset(item));
}
return (result);
} | [
"public",
"String",
"getString",
"(",
"Integer",
"type",
")",
"{",
"String",
"result",
"=",
"null",
";",
"byte",
"[",
"]",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"=",
"m_data",
... | Retrieves a string value from the extended data.
@param type Type identifier
@return string value | [
"Retrieves",
"a",
"string",
"value",
"from",
"the",
"extended",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ExtendedData.java#L79-L90 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/ExtendedData.java | ExtendedData.getInt | public int getInt(Integer type)
{
int result = 0;
byte[] item = m_map.get(type);
if (item != null)
{
result = MPPUtility.getInt(item, 0);
}
return (result);
} | java | public int getInt(Integer type)
{
int result = 0;
byte[] item = m_map.get(type);
if (item != null)
{
result = MPPUtility.getInt(item, 0);
}
return (result);
} | [
"public",
"int",
"getInt",
"(",
"Integer",
"type",
")",
"{",
"int",
"result",
"=",
"0",
";",
"byte",
"[",
"]",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"=",
"MPPUtility",
".",
... | Retrieves an integer value from the extended data.
@param type Type identifier
@return integer value | [
"Retrieves",
"an",
"integer",
"value",
"from",
"the",
"extended",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ExtendedData.java#L136-L147 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/ExtendedData.java | ExtendedData.getLong | public long getLong(Integer type)
{
long result = 0;
byte[] item = m_map.get(type);
if (item != null)
{
result = MPPUtility.getLong6(item, 0);
}
return (result);
} | java | public long getLong(Integer type)
{
long result = 0;
byte[] item = m_map.get(type);
if (item != null)
{
result = MPPUtility.getLong6(item, 0);
}
return (result);
} | [
"public",
"long",
"getLong",
"(",
"Integer",
"type",
")",
"{",
"long",
"result",
"=",
"0",
";",
"byte",
"[",
"]",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"=",
"MPPUtility",
"."... | Retrieves a long value from the extended data.
@param type Type identifier
@return long value | [
"Retrieves",
"a",
"long",
"value",
"from",
"the",
"extended",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ExtendedData.java#L155-L166 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java | ResourceAssignmentFactory.processHyperlinkData | private void processHyperlinkData(ResourceAssignment assignment, byte[] data)
{
if (data != null)
{
int offset = 12;
offset += 12;
String hyperlink = MPPUtility.getUnicodeString(data, offset);
offset += ((hyperlink.length() + 1) * 2);
offset += 12;
... | java | private void processHyperlinkData(ResourceAssignment assignment, byte[] data)
{
if (data != null)
{
int offset = 12;
offset += 12;
String hyperlink = MPPUtility.getUnicodeString(data, offset);
offset += ((hyperlink.length() + 1) * 2);
offset += 12;
... | [
"private",
"void",
"processHyperlinkData",
"(",
"ResourceAssignment",
"assignment",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"int",
"offset",
"=",
"12",
";",
"offset",
"+=",
"12",
";",
"String",
"hyperlink",
"="... | Extract assignment hyperlink data.
@param assignment assignment instance
@param data hyperlink data | [
"Extract",
"assignment",
"hyperlink",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java#L277-L303 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java | ResourceAssignmentFactory.createTimephasedData | private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete)
{
if (timephasedPlanned.isEmpty() && timephasedComplete.isEmpty())
{
Duration totalMinutes = assignment.getWork().convertUnits(TimeU... | java | private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete)
{
if (timephasedPlanned.isEmpty() && timephasedComplete.isEmpty())
{
Duration totalMinutes = assignment.getWork().convertUnits(TimeU... | [
"private",
"void",
"createTimephasedData",
"(",
"ProjectFile",
"file",
",",
"ResourceAssignment",
"assignment",
",",
"List",
"<",
"TimephasedWork",
">",
"timephasedPlanned",
",",
"List",
"<",
"TimephasedWork",
">",
"timephasedComplete",
")",
"{",
"if",
"(",
"timepha... | Method used to create missing timephased data.
@param file project file
@param assignment resource assignment
@param timephasedPlanned planned timephased data
@param timephasedComplete complete timephased data | [
"Method",
"used",
"to",
"create",
"missing",
"timephased",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java#L313-L365 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.printTimestamp | public static final String printTimestamp(Date value)
{
return (value == null ? null : TIMESTAMP_FORMAT.get().format(value));
} | java | public static final String printTimestamp(Date value)
{
return (value == null ? null : TIMESTAMP_FORMAT.get().format(value));
} | [
"public",
"static",
"final",
"String",
"printTimestamp",
"(",
"Date",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"TIMESTAMP_FORMAT",
".",
"get",
"(",
")",
".",
"format",
"(",
"value",
")",
")",
";",
"}"
] | Print a timestamp value.
@param value time value
@return time value | [
"Print",
"a",
"timestamp",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L72-L75 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.parseDuration | public static final Duration parseDuration(String value)
{
return value == null ? null : Duration.getInstance(Double.parseDouble(value), TimeUnit.DAYS);
} | java | public static final Duration parseDuration(String value)
{
return value == null ? null : Duration.getInstance(Double.parseDouble(value), TimeUnit.DAYS);
} | [
"public",
"static",
"final",
"Duration",
"parseDuration",
"(",
"String",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"Duration",
".",
"getInstance",
"(",
"Double",
".",
"parseDouble",
"(",
"value",
")",
",",
"TimeUnit",
".",
"DAYS... | Parse a duration value.
@param value duration value
@return Duration instance | [
"Parse",
"a",
"duration",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L83-L86 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.printDuration | public static final String printDuration(Duration value)
{
return value == null ? null : Double.toString(value.getDuration());
} | java | public static final String printDuration(Duration value)
{
return value == null ? null : Double.toString(value.getDuration());
} | [
"public",
"static",
"final",
"String",
"printDuration",
"(",
"Duration",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"Double",
".",
"toString",
"(",
"value",
".",
"getDuration",
"(",
")",
")",
";",
"}"
] | Print a duration value.
@param value Duration instance
@return string representation of a duration | [
"Print",
"a",
"duration",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L94-L97 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.printDate | public static final String printDate(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
} | java | public static final String printDate(Date value)
{
return (value == null ? null : DATE_FORMAT.get().format(value));
} | [
"public",
"static",
"final",
"String",
"printDate",
"(",
"Date",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"null",
":",
"DATE_FORMAT",
".",
"get",
"(",
")",
".",
"format",
"(",
"value",
")",
")",
";",
"}"
] | Print a date.
@param value Date instance
@return string representation of a date | [
"Print",
"a",
"date",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L131-L134 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.parsePercent | public static final Double parsePercent(String value)
{
return value == null ? null : Double.valueOf(Double.parseDouble(value) * 100.0);
} | java | public static final Double parsePercent(String value)
{
return value == null ? null : Double.valueOf(Double.parseDouble(value) * 100.0);
} | [
"public",
"static",
"final",
"Double",
"parsePercent",
"(",
"String",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"Double",
".",
"valueOf",
"(",
"Double",
".",
"parseDouble",
"(",
"value",
")",
"*",
"100.0",
")",
";",
"}"
] | Parse a percent complete value.
@param value sting representation of a percent complete value.
@return Double instance | [
"Parse",
"a",
"percent",
"complete",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L142-L145 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java | DatatypeConverter.printPercent | public static final String printPercent(Double value)
{
return value == null ? null : Double.toString(value.doubleValue() / 100.0);
} | java | public static final String printPercent(Double value)
{
return value == null ? null : Double.toString(value.doubleValue() / 100.0);
} | [
"public",
"static",
"final",
"String",
"printPercent",
"(",
"Double",
"value",
")",
"{",
"return",
"value",
"==",
"null",
"?",
"null",
":",
"Double",
".",
"toString",
"(",
"value",
".",
"doubleValue",
"(",
")",
"/",
"100.0",
")",
";",
"}"
] | Print a percent complete value.
@param value Double instance
@return percent complete value | [
"Print",
"a",
"percent",
"complete",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/DatatypeConverter.java#L153-L156 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/conceptdraw/schema/PPVItemsType.java | PPVItemsType.getPPVItem | public List<PPVItemsType.PPVItem> getPPVItem()
{
if (ppvItem == null)
{
ppvItem = new ArrayList<PPVItemsType.PPVItem>();
}
return this.ppvItem;
} | java | public List<PPVItemsType.PPVItem> getPPVItem()
{
if (ppvItem == null)
{
ppvItem = new ArrayList<PPVItemsType.PPVItem>();
}
return this.ppvItem;
} | [
"public",
"List",
"<",
"PPVItemsType",
".",
"PPVItem",
">",
"getPPVItem",
"(",
")",
"{",
"if",
"(",
"ppvItem",
"==",
"null",
")",
"{",
"ppvItem",
"=",
"new",
"ArrayList",
"<",
"PPVItemsType",
".",
"PPVItem",
">",
"(",
")",
";",
"}",
"return",
"this",
... | Gets the value of the ppvItem 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 ppvItem property.
<p>
For example, to add a... | [
"Gets",
"the",
"value",
"of",
"the",
"ppvItem",
"property",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/schema/PPVItemsType.java#L112-L119 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/CustomFieldContainer.java | CustomFieldContainer.getCustomField | public CustomField getCustomField(FieldType field)
{
CustomField result = m_configMap.get(field);
if (result == null)
{
result = new CustomField(field, this);
m_configMap.put(field, result);
}
return result;
} | java | public CustomField getCustomField(FieldType field)
{
CustomField result = m_configMap.get(field);
if (result == null)
{
result = new CustomField(field, this);
m_configMap.put(field, result);
}
return result;
} | [
"public",
"CustomField",
"getCustomField",
"(",
"FieldType",
"field",
")",
"{",
"CustomField",
"result",
"=",
"m_configMap",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"new",
"CustomField",
"(",
"field",... | Retrieve configuration details for a given custom field.
@param field required custom field
@return configuration detail | [
"Retrieve",
"configuration",
"details",
"for",
"a",
"given",
"custom",
"field",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/CustomFieldContainer.java#L44-L53 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/CustomFieldContainer.java | CustomFieldContainer.registerAlias | void registerAlias(FieldType type, String alias)
{
m_aliasMap.put(new Pair<FieldTypeClass, String>(type.getFieldTypeClass(), alias), type);
} | java | void registerAlias(FieldType type, String alias)
{
m_aliasMap.put(new Pair<FieldTypeClass, String>(type.getFieldTypeClass(), alias), type);
} | [
"void",
"registerAlias",
"(",
"FieldType",
"type",
",",
"String",
"alias",
")",
"{",
"m_aliasMap",
".",
"put",
"(",
"new",
"Pair",
"<",
"FieldTypeClass",
",",
"String",
">",
"(",
"type",
".",
"getFieldTypeClass",
"(",
")",
",",
"alias",
")",
",",
"type",... | When an alias for a field is added, index it here to allow lookup by alias and type.
@param type field type
@param alias field alias | [
"When",
"an",
"alias",
"for",
"a",
"field",
"is",
"added",
"index",
"it",
"here",
"to",
"allow",
"lookup",
"by",
"alias",
"and",
"type",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/CustomFieldContainer.java#L107-L110 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/CustomFieldContainer.java | CustomFieldContainer.getFieldByAlias | public FieldType getFieldByAlias(FieldTypeClass typeClass, String alias)
{
return m_aliasMap.get(new Pair<FieldTypeClass, String>(typeClass, alias));
} | java | public FieldType getFieldByAlias(FieldTypeClass typeClass, String alias)
{
return m_aliasMap.get(new Pair<FieldTypeClass, String>(typeClass, alias));
} | [
"public",
"FieldType",
"getFieldByAlias",
"(",
"FieldTypeClass",
"typeClass",
",",
"String",
"alias",
")",
"{",
"return",
"m_aliasMap",
".",
"get",
"(",
"new",
"Pair",
"<",
"FieldTypeClass",
",",
"String",
">",
"(",
"typeClass",
",",
"alias",
")",
")",
";",
... | Retrieve a field from a particular entity using its alias.
@param typeClass the type of entity we are interested in
@param alias the alias
@return the field type referred to be the alias, or null if not found | [
"Retrieve",
"a",
"field",
"from",
"a",
"particular",
"entity",
"using",
"its",
"alias",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/CustomFieldContainer.java#L119-L122 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createFieldMap | private void createFieldMap(byte[] data)
{
int index = 0;
int lastDataBlockOffset = 0;
int dataBlockIndex = 0;
while (index < data.length)
{
long mask = MPPUtility.getInt(data, index + 0);
//mask = mask << 4;
int dataBlockOffset = MPPUtility.getShort(data, i... | java | private void createFieldMap(byte[] data)
{
int index = 0;
int lastDataBlockOffset = 0;
int dataBlockIndex = 0;
while (index < data.length)
{
long mask = MPPUtility.getInt(data, index + 0);
//mask = mask << 4;
int dataBlockOffset = MPPUtility.getShort(data, i... | [
"private",
"void",
"createFieldMap",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"index",
"=",
"0",
";",
"int",
"lastDataBlockOffset",
"=",
"0",
";",
"int",
"dataBlockIndex",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"data",
".",
"length",
")",
... | Generic method used to create a field map from a block of data.
@param data field map data | [
"Generic",
"method",
"used",
"to",
"create",
"a",
"field",
"map",
"from",
"a",
"block",
"of",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L88-L200 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createTaskFieldMap | public void createTaskFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : TASK_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
populateDe... | java | public void createTaskFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : TASK_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
populateDe... | [
"public",
"void",
"createTaskFieldMap",
"(",
"Props",
"props",
")",
"{",
"byte",
"[",
"]",
"fieldMapData",
"=",
"null",
";",
"for",
"(",
"Integer",
"key",
":",
"TASK_KEYS",
")",
"{",
"fieldMapData",
"=",
"props",
".",
"getByteArray",
"(",
"key",
")",
";"... | Creates a field map for tasks.
@param props props data | [
"Creates",
"a",
"field",
"map",
"for",
"tasks",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L261-L281 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createRelationFieldMap | public void createRelationFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : RELATION_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
po... | java | public void createRelationFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : RELATION_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
po... | [
"public",
"void",
"createRelationFieldMap",
"(",
"Props",
"props",
")",
"{",
"byte",
"[",
"]",
"fieldMapData",
"=",
"null",
";",
"for",
"(",
"Integer",
"key",
":",
"RELATION_KEYS",
")",
"{",
"fieldMapData",
"=",
"props",
".",
"getByteArray",
"(",
"key",
")... | Creates a field map for relations.
@param props props data | [
"Creates",
"a",
"field",
"map",
"for",
"relations",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L288-L308 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createEnterpriseCustomFieldMap | public void createEnterpriseCustomFieldMap(Props props, Class<?> c)
{
byte[] fieldMapData = null;
for (Integer key : ENTERPRISE_CUSTOM_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData... | java | public void createEnterpriseCustomFieldMap(Props props, Class<?> c)
{
byte[] fieldMapData = null;
for (Integer key : ENTERPRISE_CUSTOM_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData... | [
"public",
"void",
"createEnterpriseCustomFieldMap",
"(",
"Props",
"props",
",",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"byte",
"[",
"]",
"fieldMapData",
"=",
"null",
";",
"for",
"(",
"Integer",
"key",
":",
"ENTERPRISE_CUSTOM_KEYS",
")",
"{",
"fieldMapData",
... | Create a field map for enterprise custom fields.
@param props props data
@param c target class | [
"Create",
"a",
"field",
"map",
"for",
"enterprise",
"custom",
"fields",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L316-L349 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createResourceFieldMap | public void createResourceFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : RESOURCE_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
po... | java | public void createResourceFieldMap(Props props)
{
byte[] fieldMapData = null;
for (Integer key : RESOURCE_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if (fieldMapData == null)
{
po... | [
"public",
"void",
"createResourceFieldMap",
"(",
"Props",
"props",
")",
"{",
"byte",
"[",
"]",
"fieldMapData",
"=",
"null",
";",
"for",
"(",
"Integer",
"key",
":",
"RESOURCE_KEYS",
")",
"{",
"fieldMapData",
"=",
"props",
".",
"getByteArray",
"(",
"key",
")... | Creates a field map for resources.
@param props props data | [
"Creates",
"a",
"field",
"map",
"for",
"resources",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L356-L376 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.createAssignmentFieldMap | public void createAssignmentFieldMap(Props props)
{
//System.out.println("ASSIGN");
byte[] fieldMapData = null;
for (Integer key : ASSIGNMENT_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if ... | java | public void createAssignmentFieldMap(Props props)
{
//System.out.println("ASSIGN");
byte[] fieldMapData = null;
for (Integer key : ASSIGNMENT_KEYS)
{
fieldMapData = props.getByteArray(key);
if (fieldMapData != null)
{
break;
}
}
if ... | [
"public",
"void",
"createAssignmentFieldMap",
"(",
"Props",
"props",
")",
"{",
"//System.out.println(\"ASSIGN\");",
"byte",
"[",
"]",
"fieldMapData",
"=",
"null",
";",
"for",
"(",
"Integer",
"key",
":",
"ASSIGNMENT_KEYS",
")",
"{",
"fieldMapData",
"=",
"props",
... | Creates a field map for assignments.
@param props props data | [
"Creates",
"a",
"field",
"map",
"for",
"assignments",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L383-L404 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.populateDefaultData | private void populateDefaultData(FieldItem[] defaultData)
{
for (FieldItem item : defaultData)
{
m_map.put(item.getType(), item);
}
} | java | private void populateDefaultData(FieldItem[] defaultData)
{
for (FieldItem item : defaultData)
{
m_map.put(item.getType(), item);
}
} | [
"private",
"void",
"populateDefaultData",
"(",
"FieldItem",
"[",
"]",
"defaultData",
")",
"{",
"for",
"(",
"FieldItem",
"item",
":",
"defaultData",
")",
"{",
"m_map",
".",
"put",
"(",
"item",
".",
"getType",
"(",
")",
",",
"item",
")",
";",
"}",
"}"
] | This method takes an array of data and uses this to populate the
field map.
@param defaultData field map default data | [
"This",
"method",
"takes",
"an",
"array",
"of",
"data",
"and",
"uses",
"this",
"to",
"populate",
"the",
"field",
"map",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L412-L418 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.populateContainer | public void populateContainer(Class<? extends FieldType> type, FieldContainer container, Integer id, byte[][] fixedData, Var2Data varData)
{
//System.out.println(container.getClass().getSimpleName()+": " + id);
for (FieldItem item : m_map.values())
{
if (item.getType().getClass().equals(ty... | java | public void populateContainer(Class<? extends FieldType> type, FieldContainer container, Integer id, byte[][] fixedData, Var2Data varData)
{
//System.out.println(container.getClass().getSimpleName()+": " + id);
for (FieldItem item : m_map.values())
{
if (item.getType().getClass().equals(ty... | [
"public",
"void",
"populateContainer",
"(",
"Class",
"<",
"?",
"extends",
"FieldType",
">",
"type",
",",
"FieldContainer",
"container",
",",
"Integer",
"id",
",",
"byte",
"[",
"]",
"[",
"]",
"fixedData",
",",
"Var2Data",
"varData",
")",
"{",
"//System.out.pr... | Given a container, and a set of raw data blocks, this method extracts
the field data and writes it into the container.
@param type expected type
@param container field container
@param id entity ID
@param fixedData fixed data block
@param varData var data block | [
"Given",
"a",
"container",
"and",
"a",
"set",
"of",
"raw",
"data",
"blocks",
"this",
"method",
"extracts",
"the",
"field",
"data",
"and",
"writes",
"it",
"into",
"the",
"container",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L430-L443 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getFixedDataOffset | public int getFixedDataOffset(FieldType type)
{
int result;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getFixedDataOffset();
}
else
{
result = -1;
}
return result;
} | java | public int getFixedDataOffset(FieldType type)
{
int result;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getFixedDataOffset();
}
else
{
result = -1;
}
return result;
} | [
"public",
"int",
"getFixedDataOffset",
"(",
"FieldType",
"type",
")",
"{",
"int",
"result",
";",
"FieldItem",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"=",
"item",
".",
"getFixedDataO... | Retrieve the fixed data offset for a specific field.
@param type field type
@return offset | [
"Retrieve",
"the",
"fixed",
"data",
"offset",
"for",
"a",
"specific",
"field",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L462-L475 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getVarDataKey | public Integer getVarDataKey(FieldType type)
{
Integer result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getVarDataKey();
}
return result;
} | java | public Integer getVarDataKey(FieldType type)
{
Integer result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getVarDataKey();
}
return result;
} | [
"public",
"Integer",
"getVarDataKey",
"(",
"FieldType",
"type",
")",
"{",
"Integer",
"result",
"=",
"null",
";",
"FieldItem",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"=",
"item",
"... | Retrieve the var data key for a specific field.
@param type field type
@return var data key | [
"Retrieve",
"the",
"var",
"data",
"key",
"for",
"a",
"specific",
"field",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L483-L492 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getFieldTypeFromVarDataKey | public FieldType getFieldTypeFromVarDataKey(Integer key)
{
FieldType result = null;
for (Entry<FieldType, FieldMap.FieldItem> entry : m_map.entrySet())
{
if (entry.getValue().getFieldLocation() == FieldLocation.VAR_DATA && entry.getValue().getVarDataKey().equals(key))
{
... | java | public FieldType getFieldTypeFromVarDataKey(Integer key)
{
FieldType result = null;
for (Entry<FieldType, FieldMap.FieldItem> entry : m_map.entrySet())
{
if (entry.getValue().getFieldLocation() == FieldLocation.VAR_DATA && entry.getValue().getVarDataKey().equals(key))
{
... | [
"public",
"FieldType",
"getFieldTypeFromVarDataKey",
"(",
"Integer",
"key",
")",
"{",
"FieldType",
"result",
"=",
"null",
";",
"for",
"(",
"Entry",
"<",
"FieldType",
",",
"FieldMap",
".",
"FieldItem",
">",
"entry",
":",
"m_map",
".",
"entrySet",
"(",
")",
... | Used to map from a var data key to a field type. Note this
is designed for diagnostic use only, and uses an inefficient search.
@param key var data key
@return field type | [
"Used",
"to",
"map",
"from",
"a",
"var",
"data",
"key",
"to",
"a",
"field",
"type",
".",
"Note",
"this",
"is",
"designed",
"for",
"diagnostic",
"use",
"only",
"and",
"uses",
"an",
"inefficient",
"search",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L501-L513 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getFieldLocation | public FieldLocation getFieldLocation(FieldType type)
{
FieldLocation result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getFieldLocation();
}
return result;
} | java | public FieldLocation getFieldLocation(FieldType type)
{
FieldLocation result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.getFieldLocation();
}
return result;
} | [
"public",
"FieldLocation",
"getFieldLocation",
"(",
"FieldType",
"type",
")",
"{",
"FieldLocation",
"result",
"=",
"null",
";",
"FieldItem",
"item",
"=",
"m_map",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"result",
"="... | Retrieve the field location for a specific field.
@param type field type
@return field location | [
"Retrieve",
"the",
"field",
"location",
"for",
"a",
"specific",
"field",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L521-L531 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getFieldData | protected Object getFieldData(Integer id, FieldType type, byte[][] fixedData, Var2Data varData)
{
Object result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.read(id, fixedData, varData);
}
return result;
} | java | protected Object getFieldData(Integer id, FieldType type, byte[][] fixedData, Var2Data varData)
{
Object result = null;
FieldItem item = m_map.get(type);
if (item != null)
{
result = item.read(id, fixedData, varData);
}
return result;
} | [
"protected",
"Object",
"getFieldData",
"(",
"Integer",
"id",
",",
"FieldType",
"type",
",",
"byte",
"[",
"]",
"[",
"]",
"fixedData",
",",
"Var2Data",
"varData",
")",
"{",
"Object",
"result",
"=",
"null",
";",
"FieldItem",
"item",
"=",
"m_map",
".",
"get"... | Retrieve a single field value.
@param id parent entity ID
@param type field type
@param fixedData fixed data block
@param varData var data block
@return field value | [
"Retrieve",
"a",
"single",
"field",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L542-L553 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.dumpKnownFieldMaps | public void dumpKnownFieldMaps(Props props)
{
//for (int key=131092; key < 131098; key++)
for (int key = 50331668; key < 50331674; key++)
{
byte[] fieldMapData = props.getByteArray(Integer.valueOf(key));
if (fieldMapData != null)
{
System.out.println("KEY: " +... | java | public void dumpKnownFieldMaps(Props props)
{
//for (int key=131092; key < 131098; key++)
for (int key = 50331668; key < 50331674; key++)
{
byte[] fieldMapData = props.getByteArray(Integer.valueOf(key));
if (fieldMapData != null)
{
System.out.println("KEY: " +... | [
"public",
"void",
"dumpKnownFieldMaps",
"(",
"Props",
"props",
")",
"{",
"//for (int key=131092; key < 131098; key++)",
"for",
"(",
"int",
"key",
"=",
"50331668",
";",
"key",
"<",
"50331674",
";",
"key",
"++",
")",
"{",
"byte",
"[",
"]",
"fieldMapData",
"=",
... | Diagnostic method used to dump known field map data.
@param props props block containing field map data | [
"Diagnostic",
"method",
"used",
"to",
"dump",
"known",
"field",
"map",
"data",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L579-L593 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.getFixedDataFieldSize | private int getFixedDataFieldSize(FieldType type)
{
int result = 0;
DataType dataType = type.getDataType();
if (dataType != null)
{
switch (dataType)
{
case DATE:
case INTEGER:
case DURATION:
{
result = 4;
... | java | private int getFixedDataFieldSize(FieldType type)
{
int result = 0;
DataType dataType = type.getDataType();
if (dataType != null)
{
switch (dataType)
{
case DATE:
case INTEGER:
case DURATION:
{
result = 4;
... | [
"private",
"int",
"getFixedDataFieldSize",
"(",
"FieldType",
"type",
")",
"{",
"int",
"result",
"=",
"0",
";",
"DataType",
"dataType",
"=",
"type",
".",
"getDataType",
"(",
")",
";",
"if",
"(",
"dataType",
"!=",
"null",
")",
"{",
"switch",
"(",
"dataType... | Determine the size of a field in a fixed data block.
@param type field data type
@return field size in bytes | [
"Determine",
"the",
"size",
"of",
"a",
"field",
"in",
"a",
"fixed",
"data",
"block",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L601-L665 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.setParent | void setParent(ProjectCalendarWeek parent)
{
m_parent = parent;
for (int loop = 0; loop < m_days.length; loop++)
{
if (m_days[loop] == null)
{
m_days[loop] = DayType.DEFAULT;
}
}
} | java | void setParent(ProjectCalendarWeek parent)
{
m_parent = parent;
for (int loop = 0; loop < m_days.length; loop++)
{
if (m_days[loop] == null)
{
m_days[loop] = DayType.DEFAULT;
}
}
} | [
"void",
"setParent",
"(",
"ProjectCalendarWeek",
"parent",
")",
"{",
"m_parent",
"=",
"parent",
";",
"for",
"(",
"int",
"loop",
"=",
"0",
";",
"loop",
"<",
"m_days",
".",
"length",
";",
"loop",
"++",
")",
"{",
"if",
"(",
"m_days",
"[",
"loop",
"]",
... | Set the parent from which this week is derived.
@param parent parent week | [
"Set",
"the",
"parent",
"from",
"which",
"this",
"week",
"is",
"derived",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L94-L105 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.getHours | public ProjectCalendarHours getHours(Day day)
{
ProjectCalendarHours result = getCalendarHours(day);
if (result == null)
{
//
// If this is a base calendar and we have no hours, then we
// have a problem - so we add the default hours and try again
//
if ... | java | public ProjectCalendarHours getHours(Day day)
{
ProjectCalendarHours result = getCalendarHours(day);
if (result == null)
{
//
// If this is a base calendar and we have no hours, then we
// have a problem - so we add the default hours and try again
//
if ... | [
"public",
"ProjectCalendarHours",
"getHours",
"(",
"Day",
"day",
")",
"{",
"ProjectCalendarHours",
"result",
"=",
"getCalendarHours",
"(",
"day",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"//",
"// If this is a base calendar and we have no hours, then we"... | This method retrieves the calendar hours for the specified day.
Note that if this is a derived calendar, then this method
will refer to the base calendar where no hours are specified
in the derived calendar.
@param day Day instance
@return calendar hours | [
"This",
"method",
"retrieves",
"the",
"calendar",
"hours",
"for",
"the",
"specified",
"day",
".",
"Note",
"that",
"if",
"this",
"is",
"a",
"derived",
"calendar",
"then",
"this",
"method",
"will",
"refer",
"to",
"the",
"base",
"calendar",
"where",
"no",
"ho... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L162-L183 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.addDefaultCalendarHours | public void addDefaultCalendarHours(Day day)
{
ProjectCalendarHours hours = addCalendarHours(day);
if (day != Day.SATURDAY && day != Day.SUNDAY)
{
hours.addRange(DEFAULT_WORKING_MORNING);
hours.addRange(DEFAULT_WORKING_AFTERNOON);
}
} | java | public void addDefaultCalendarHours(Day day)
{
ProjectCalendarHours hours = addCalendarHours(day);
if (day != Day.SATURDAY && day != Day.SUNDAY)
{
hours.addRange(DEFAULT_WORKING_MORNING);
hours.addRange(DEFAULT_WORKING_AFTERNOON);
}
} | [
"public",
"void",
"addDefaultCalendarHours",
"(",
"Day",
"day",
")",
"{",
"ProjectCalendarHours",
"hours",
"=",
"addCalendarHours",
"(",
"day",
")",
";",
"if",
"(",
"day",
"!=",
"Day",
".",
"SATURDAY",
"&&",
"day",
"!=",
"Day",
".",
"SUNDAY",
")",
"{",
"... | This is a convenience method used to add a default set of calendar
hours to a calendar.
@param day Day for which to add default hours for | [
"This",
"is",
"a",
"convenience",
"method",
"used",
"to",
"add",
"a",
"default",
"set",
"of",
"calendar",
"hours",
"to",
"a",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L203-L212 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.addCalendarHours | public ProjectCalendarHours addCalendarHours(Day day)
{
ProjectCalendarHours bch = new ProjectCalendarHours(this);
bch.setDay(day);
m_hours[day.getValue() - 1] = bch;
return (bch);
} | java | public ProjectCalendarHours addCalendarHours(Day day)
{
ProjectCalendarHours bch = new ProjectCalendarHours(this);
bch.setDay(day);
m_hours[day.getValue() - 1] = bch;
return (bch);
} | [
"public",
"ProjectCalendarHours",
"addCalendarHours",
"(",
"Day",
"day",
")",
"{",
"ProjectCalendarHours",
"bch",
"=",
"new",
"ProjectCalendarHours",
"(",
"this",
")",
";",
"bch",
".",
"setDay",
"(",
"day",
")",
";",
"m_hours",
"[",
"day",
".",
"getValue",
"... | Used to add working hours to the calendar. Note that the MPX file
definition allows a maximum of 7 calendar hours records to be added to
a single calendar.
@param day day number
@return new ProjectCalendarHours instance | [
"Used",
"to",
"add",
"working",
"hours",
"to",
"the",
"calendar",
".",
"Note",
"that",
"the",
"MPX",
"file",
"definition",
"allows",
"a",
"maximum",
"of",
"7",
"calendar",
"hours",
"records",
"to",
"be",
"added",
"to",
"a",
"single",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L222-L228 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.attachHoursToDay | public void attachHoursToDay(ProjectCalendarHours hours)
{
if (hours.getParentCalendar() != this)
{
throw new IllegalArgumentException();
}
m_hours[hours.getDay().getValue() - 1] = hours;
} | java | public void attachHoursToDay(ProjectCalendarHours hours)
{
if (hours.getParentCalendar() != this)
{
throw new IllegalArgumentException();
}
m_hours[hours.getDay().getValue() - 1] = hours;
} | [
"public",
"void",
"attachHoursToDay",
"(",
"ProjectCalendarHours",
"hours",
")",
"{",
"if",
"(",
"hours",
".",
"getParentCalendar",
"(",
")",
"!=",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"m_hours",
"[",
"hours",
"."... | Attaches a pre-existing set of hours to the correct
day within the calendar.
@param hours calendar hours instance | [
"Attaches",
"a",
"pre",
"-",
"existing",
"set",
"of",
"hours",
"to",
"the",
"correct",
"day",
"within",
"the",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L236-L243 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.removeHoursFromDay | public void removeHoursFromDay(ProjectCalendarHours hours)
{
if (hours.getParentCalendar() != this)
{
throw new IllegalArgumentException();
}
m_hours[hours.getDay().getValue() - 1] = null;
} | java | public void removeHoursFromDay(ProjectCalendarHours hours)
{
if (hours.getParentCalendar() != this)
{
throw new IllegalArgumentException();
}
m_hours[hours.getDay().getValue() - 1] = null;
} | [
"public",
"void",
"removeHoursFromDay",
"(",
"ProjectCalendarHours",
"hours",
")",
"{",
"if",
"(",
"hours",
".",
"getParentCalendar",
"(",
")",
"!=",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"m_hours",
"[",
"hours",
"... | Removes a set of calendar hours from the day to which they
are currently attached.
@param hours calendar hours instance | [
"Removes",
"a",
"set",
"of",
"calendar",
"hours",
"from",
"the",
"day",
"to",
"which",
"they",
"are",
"currently",
"attached",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L251-L258 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.setWorkingDay | public void setWorkingDay(Day day, boolean working)
{
setWorkingDay(day, (working ? DayType.WORKING : DayType.NON_WORKING));
} | java | public void setWorkingDay(Day day, boolean working)
{
setWorkingDay(day, (working ? DayType.WORKING : DayType.NON_WORKING));
} | [
"public",
"void",
"setWorkingDay",
"(",
"Day",
"day",
",",
"boolean",
"working",
")",
"{",
"setWorkingDay",
"(",
"day",
",",
"(",
"working",
"?",
"DayType",
".",
"WORKING",
":",
"DayType",
".",
"NON_WORKING",
")",
")",
";",
"}"
] | convenience method for setting working or non-working days.
@param day required day
@param working flag indicating if the day is a working day | [
"convenience",
"method",
"for",
"setting",
"working",
"or",
"non",
"-",
"working",
"days",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L294-L297 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.setWorkingDay | public void setWorkingDay(Day day, DayType working)
{
DayType value;
if (working == null)
{
if (isDerived())
{
value = DayType.DEFAULT;
}
else
{
value = DayType.WORKING;
}
}
else
{
value = work... | java | public void setWorkingDay(Day day, DayType working)
{
DayType value;
if (working == null)
{
if (isDerived())
{
value = DayType.DEFAULT;
}
else
{
value = DayType.WORKING;
}
}
else
{
value = work... | [
"public",
"void",
"setWorkingDay",
"(",
"Day",
"day",
",",
"DayType",
"working",
")",
"{",
"DayType",
"value",
";",
"if",
"(",
"working",
"==",
"null",
")",
"{",
"if",
"(",
"isDerived",
"(",
")",
")",
"{",
"value",
"=",
"DayType",
".",
"DEFAULT",
";"... | This is a convenience method provided to allow a day to be set
as working or non-working, by using the day number to
identify the required day.
@param day required day
@param working flag indicating if the day is a working day | [
"This",
"is",
"a",
"convenience",
"method",
"provided",
"to",
"allow",
"a",
"day",
"to",
"be",
"set",
"as",
"working",
"or",
"non",
"-",
"working",
"by",
"using",
"the",
"day",
"number",
"to",
"identify",
"the",
"required",
"day",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L307-L328 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.readCalendar | private void readCalendar(Gantt gantt)
{
Gantt.Calendar ganttCalendar = gantt.getCalendar();
m_projectFile.getProjectProperties().setWeekStartDay(ganttCalendar.getWeekStart());
ProjectCalendar calendar = m_projectFile.addCalendar();
calendar.setName("Standard");
m_projectFile.setDefaul... | java | private void readCalendar(Gantt gantt)
{
Gantt.Calendar ganttCalendar = gantt.getCalendar();
m_projectFile.getProjectProperties().setWeekStartDay(ganttCalendar.getWeekStart());
ProjectCalendar calendar = m_projectFile.addCalendar();
calendar.setName("Standard");
m_projectFile.setDefaul... | [
"private",
"void",
"readCalendar",
"(",
"Gantt",
"gantt",
")",
"{",
"Gantt",
".",
"Calendar",
"ganttCalendar",
"=",
"gantt",
".",
"getCalendar",
"(",
")",
";",
"m_projectFile",
".",
"getProjectProperties",
"(",
")",
".",
"setWeekStartDay",
"(",
"ganttCalendar",
... | Read the calendar data from a Gantt Designer file.
@param gantt Gantt Designer file. | [
"Read",
"the",
"calendar",
"data",
"from",
"a",
"Gantt",
"Designer",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L162-L196 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.processTasks | private void processTasks(Gantt gantt)
{
ProjectCalendar calendar = m_projectFile.getDefaultCalendar();
for (Gantt.Tasks.Task ganttTask : gantt.getTasks().getTask())
{
String wbs = ganttTask.getID();
ChildTaskContainer parentTask = getParentTask(wbs);
Task task = parent... | java | private void processTasks(Gantt gantt)
{
ProjectCalendar calendar = m_projectFile.getDefaultCalendar();
for (Gantt.Tasks.Task ganttTask : gantt.getTasks().getTask())
{
String wbs = ganttTask.getID();
ChildTaskContainer parentTask = getParentTask(wbs);
Task task = parent... | [
"private",
"void",
"processTasks",
"(",
"Gantt",
"gantt",
")",
"{",
"ProjectCalendar",
"calendar",
"=",
"m_projectFile",
".",
"getDefaultCalendar",
"(",
")",
";",
"for",
"(",
"Gantt",
".",
"Tasks",
".",
"Task",
"ganttTask",
":",
"gantt",
".",
"getTasks",
"("... | Read task data from a Gantt Designer file.
@param gantt Gantt Designer file | [
"Read",
"task",
"data",
"from",
"a",
"Gantt",
"Designer",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L215-L242 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.processPredecessors | private void processPredecessors(Gantt gantt)
{
for (Gantt.Tasks.Task ganttTask : gantt.getTasks().getTask())
{
String predecessors = ganttTask.getP();
if (predecessors != null && !predecessors.isEmpty())
{
String wbs = ganttTask.getID();
Task task = m_t... | java | private void processPredecessors(Gantt gantt)
{
for (Gantt.Tasks.Task ganttTask : gantt.getTasks().getTask())
{
String predecessors = ganttTask.getP();
if (predecessors != null && !predecessors.isEmpty())
{
String wbs = ganttTask.getID();
Task task = m_t... | [
"private",
"void",
"processPredecessors",
"(",
"Gantt",
"gantt",
")",
"{",
"for",
"(",
"Gantt",
".",
"Tasks",
".",
"Task",
"ganttTask",
":",
"gantt",
".",
"getTasks",
"(",
")",
".",
"getTask",
"(",
")",
")",
"{",
"String",
"predecessors",
"=",
"ganttTask... | Read predecessors from a Gantt Designer file.
@param gantt Gantt Designer file | [
"Read",
"predecessors",
"from",
"a",
"Gantt",
"Designer",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L249-L265 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.processRemarks | private void processRemarks(Gantt gantt)
{
processRemarks(gantt.getRemarks());
processRemarks(gantt.getRemarks1());
processRemarks(gantt.getRemarks2());
processRemarks(gantt.getRemarks3());
processRemarks(gantt.getRemarks4());
} | java | private void processRemarks(Gantt gantt)
{
processRemarks(gantt.getRemarks());
processRemarks(gantt.getRemarks1());
processRemarks(gantt.getRemarks2());
processRemarks(gantt.getRemarks3());
processRemarks(gantt.getRemarks4());
} | [
"private",
"void",
"processRemarks",
"(",
"Gantt",
"gantt",
")",
"{",
"processRemarks",
"(",
"gantt",
".",
"getRemarks",
"(",
")",
")",
";",
"processRemarks",
"(",
"gantt",
".",
"getRemarks1",
"(",
")",
")",
";",
"processRemarks",
"(",
"gantt",
".",
"getRe... | Read remarks from a Gantt Designer file.
@param gantt Gantt Designer file | [
"Read",
"remarks",
"from",
"a",
"Gantt",
"Designer",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L272-L279 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.processRemarks | private void processRemarks(GanttDesignerRemark remark)
{
for (GanttDesignerRemark.Task remarkTask : remark.getTask())
{
Integer id = remarkTask.getRow();
Task task = m_projectFile.getTaskByID(id);
String notes = task.getNotes();
if (notes.isEmpty())
{
... | java | private void processRemarks(GanttDesignerRemark remark)
{
for (GanttDesignerRemark.Task remarkTask : remark.getTask())
{
Integer id = remarkTask.getRow();
Task task = m_projectFile.getTaskByID(id);
String notes = task.getNotes();
if (notes.isEmpty())
{
... | [
"private",
"void",
"processRemarks",
"(",
"GanttDesignerRemark",
"remark",
")",
"{",
"for",
"(",
"GanttDesignerRemark",
".",
"Task",
"remarkTask",
":",
"remark",
".",
"getTask",
"(",
")",
")",
"{",
"Integer",
"id",
"=",
"remarkTask",
".",
"getRow",
"(",
")",... | Read an individual remark type from a Gantt Designer file.
@param remark remark type | [
"Read",
"an",
"individual",
"remark",
"type",
"from",
"a",
"Gantt",
"Designer",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L286-L303 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.getParentWBS | private String getParentWBS(String wbs)
{
String result;
int index = wbs.lastIndexOf('.');
if (index == -1)
{
result = null;
}
else
{
result = wbs.substring(0, index);
}
return result;
} | java | private String getParentWBS(String wbs)
{
String result;
int index = wbs.lastIndexOf('.');
if (index == -1)
{
result = null;
}
else
{
result = wbs.substring(0, index);
}
return result;
} | [
"private",
"String",
"getParentWBS",
"(",
"String",
"wbs",
")",
"{",
"String",
"result",
";",
"int",
"index",
"=",
"wbs",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"result",
"=",
"null",
";",
"}",
... | Extract the parent WBS from a WBS.
@param wbs current WBS
@return parent WBS | [
"Extract",
"the",
"parent",
"WBS",
"from",
"a",
"WBS",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L311-L324 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java | GanttDesignerReader.getParentTask | private ChildTaskContainer getParentTask(String wbs)
{
ChildTaskContainer result;
String parentWbs = getParentWBS(wbs);
if (parentWbs == null)
{
result = m_projectFile;
}
else
{
result = m_taskMap.get(parentWbs);
}
return result;
} | java | private ChildTaskContainer getParentTask(String wbs)
{
ChildTaskContainer result;
String parentWbs = getParentWBS(wbs);
if (parentWbs == null)
{
result = m_projectFile;
}
else
{
result = m_taskMap.get(parentWbs);
}
return result;
} | [
"private",
"ChildTaskContainer",
"getParentTask",
"(",
"String",
"wbs",
")",
"{",
"ChildTaskContainer",
"result",
";",
"String",
"parentWbs",
"=",
"getParentWBS",
"(",
"wbs",
")",
";",
"if",
"(",
"parentWbs",
"==",
"null",
")",
"{",
"result",
"=",
"m_projectFi... | Retrieve the parent task based on its WBS.
@param wbs parent WBS
@return parent task | [
"Retrieve",
"the",
"parent",
"task",
"based",
"on",
"its",
"WBS",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttdesigner/GanttDesignerReader.java#L332-L345 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/PoiTreeModel.java | PoiTreeModel.getChildNodes | private List<Entry> getChildNodes(DirectoryEntry parent)
{
List<Entry> result = new ArrayList<Entry>();
Iterator<Entry> entries = parent.getEntries();
while (entries.hasNext())
{
result.add(entries.next());
}
return result;
} | java | private List<Entry> getChildNodes(DirectoryEntry parent)
{
List<Entry> result = new ArrayList<Entry>();
Iterator<Entry> entries = parent.getEntries();
while (entries.hasNext())
{
result.add(entries.next());
}
return result;
} | [
"private",
"List",
"<",
"Entry",
">",
"getChildNodes",
"(",
"DirectoryEntry",
"parent",
")",
"{",
"List",
"<",
"Entry",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Entry",
">",
"(",
")",
";",
"Iterator",
"<",
"Entry",
">",
"entries",
"=",
"parent",
"... | Retrieves child nodes from a directory entry.
@param parent parent directory entry
@return list of child nodes | [
"Retrieves",
"child",
"nodes",
"from",
"a",
"directory",
"entry",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/PoiTreeModel.java#L136-L145 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/PoiTreeModel.java | PoiTreeModel.fireTreeStructureChanged | private void fireTreeStructureChanged()
{
// Guaranteed to return a non-null array
Object[] listeners = m_listenerList.getListenerList();
TreeModelEvent e = null;
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i = listeners.le... | java | private void fireTreeStructureChanged()
{
// Guaranteed to return a non-null array
Object[] listeners = m_listenerList.getListenerList();
TreeModelEvent e = null;
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i = listeners.le... | [
"private",
"void",
"fireTreeStructureChanged",
"(",
")",
"{",
"// Guaranteed to return a non-null array",
"Object",
"[",
"]",
"listeners",
"=",
"m_listenerList",
".",
"getListenerList",
"(",
")",
";",
"TreeModelEvent",
"e",
"=",
"null",
";",
"// Process the listeners la... | Notify listeners that the tree structure has changed. | [
"Notify",
"listeners",
"that",
"the",
"tree",
"structure",
"has",
"changed",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/PoiTreeModel.java#L150-L172 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getMinutesPerDay | public int getMinutesPerDay()
{
return m_minutesPerDay == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerDay()) : m_minutesPerDay.intValue();
} | java | public int getMinutesPerDay()
{
return m_minutesPerDay == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerDay()) : m_minutesPerDay.intValue();
} | [
"public",
"int",
"getMinutesPerDay",
"(",
")",
"{",
"return",
"m_minutesPerDay",
"==",
"null",
"?",
"NumberHelper",
".",
"getInt",
"(",
"getParentFile",
"(",
")",
".",
"getProjectProperties",
"(",
")",
".",
"getMinutesPerDay",
"(",
")",
")",
":",
"m_minutesPer... | Retrieve the number of minutes per day for this calendar.
@return minutes per day | [
"Retrieve",
"the",
"number",
"of",
"minutes",
"per",
"day",
"for",
"this",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L67-L70 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getMinutesPerWeek | public int getMinutesPerWeek()
{
return m_minutesPerWeek == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerWeek()) : m_minutesPerWeek.intValue();
} | java | public int getMinutesPerWeek()
{
return m_minutesPerWeek == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerWeek()) : m_minutesPerWeek.intValue();
} | [
"public",
"int",
"getMinutesPerWeek",
"(",
")",
"{",
"return",
"m_minutesPerWeek",
"==",
"null",
"?",
"NumberHelper",
".",
"getInt",
"(",
"getParentFile",
"(",
")",
".",
"getProjectProperties",
"(",
")",
".",
"getMinutesPerWeek",
"(",
")",
")",
":",
"m_minutes... | Retrieve the number of minutes per week for this calendar.
@return minutes per week | [
"Retrieve",
"the",
"number",
"of",
"minutes",
"per",
"week",
"for",
"this",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L77-L80 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getMinutesPerMonth | public int getMinutesPerMonth()
{
return m_minutesPerMonth == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerMonth()) : m_minutesPerMonth.intValue();
} | java | public int getMinutesPerMonth()
{
return m_minutesPerMonth == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerMonth()) : m_minutesPerMonth.intValue();
} | [
"public",
"int",
"getMinutesPerMonth",
"(",
")",
"{",
"return",
"m_minutesPerMonth",
"==",
"null",
"?",
"NumberHelper",
".",
"getInt",
"(",
"getParentFile",
"(",
")",
".",
"getProjectProperties",
"(",
")",
".",
"getMinutesPerMonth",
"(",
")",
")",
":",
"m_minu... | Retrieve the number of minutes per month for this calendar.
@return minutes per month | [
"Retrieve",
"the",
"number",
"of",
"minutes",
"per",
"month",
"for",
"this",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L87-L90 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getMinutesPerYear | public int getMinutesPerYear()
{
return m_minutesPerYear == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerYear()) : m_minutesPerYear.intValue();
} | java | public int getMinutesPerYear()
{
return m_minutesPerYear == null ? NumberHelper.getInt(getParentFile().getProjectProperties().getMinutesPerYear()) : m_minutesPerYear.intValue();
} | [
"public",
"int",
"getMinutesPerYear",
"(",
")",
"{",
"return",
"m_minutesPerYear",
"==",
"null",
"?",
"NumberHelper",
".",
"getInt",
"(",
"getParentFile",
"(",
")",
".",
"getProjectProperties",
"(",
")",
".",
"getMinutesPerYear",
"(",
")",
")",
":",
"m_minutes... | Retrieve the number of minutes per year for this calendar.
@return minutes per year | [
"Retrieve",
"the",
"number",
"of",
"minutes",
"per",
"year",
"for",
"this",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L97-L100 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.addWorkWeek | public ProjectCalendarWeek addWorkWeek()
{
ProjectCalendarWeek week = new ProjectCalendarWeek();
week.setParent(this);
m_workWeeks.add(week);
m_weeksSorted = false;
clearWorkingDateCache();
return week;
} | java | public ProjectCalendarWeek addWorkWeek()
{
ProjectCalendarWeek week = new ProjectCalendarWeek();
week.setParent(this);
m_workWeeks.add(week);
m_weeksSorted = false;
clearWorkingDateCache();
return week;
} | [
"public",
"ProjectCalendarWeek",
"addWorkWeek",
"(",
")",
"{",
"ProjectCalendarWeek",
"week",
"=",
"new",
"ProjectCalendarWeek",
"(",
")",
";",
"week",
".",
"setParent",
"(",
"this",
")",
";",
"m_workWeeks",
".",
"add",
"(",
"week",
")",
";",
"m_weeksSorted",
... | Add an empty work week.
@return new work week | [
"Add",
"an",
"empty",
"work",
"week",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L147-L155 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.addCalendarException | public ProjectCalendarException addCalendarException(Date fromDate, Date toDate)
{
ProjectCalendarException bce = new ProjectCalendarException(fromDate, toDate);
m_exceptions.add(bce);
m_expandedExceptions.clear();
m_exceptionsSorted = false;
clearWorkingDateCache();
return bce;
... | java | public ProjectCalendarException addCalendarException(Date fromDate, Date toDate)
{
ProjectCalendarException bce = new ProjectCalendarException(fromDate, toDate);
m_exceptions.add(bce);
m_expandedExceptions.clear();
m_exceptionsSorted = false;
clearWorkingDateCache();
return bce;
... | [
"public",
"ProjectCalendarException",
"addCalendarException",
"(",
"Date",
"fromDate",
",",
"Date",
"toDate",
")",
"{",
"ProjectCalendarException",
"bce",
"=",
"new",
"ProjectCalendarException",
"(",
"fromDate",
",",
"toDate",
")",
";",
"m_exceptions",
".",
"add",
"... | Used to add exceptions to the calendar. The MPX standard defines
a limit of 250 exceptions per calendar.
@param fromDate exception start date
@param toDate exception end date
@return ProjectCalendarException instance | [
"Used",
"to",
"add",
"exceptions",
"to",
"the",
"calendar",
".",
"The",
"MPX",
"standard",
"defines",
"a",
"limit",
"of",
"250",
"exceptions",
"per",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L185-L193 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.setParent | public void setParent(ProjectCalendar calendar)
{
// I've seen a malformed MSPDI file which sets the parent calendar to itself.
// Silently ignore this here.
if (calendar != this)
{
if (getParent() != null)
{
getParent().removeDerivedCalendar(this);
}
... | java | public void setParent(ProjectCalendar calendar)
{
// I've seen a malformed MSPDI file which sets the parent calendar to itself.
// Silently ignore this here.
if (calendar != this)
{
if (getParent() != null)
{
getParent().removeDerivedCalendar(this);
}
... | [
"public",
"void",
"setParent",
"(",
"ProjectCalendar",
"calendar",
")",
"{",
"// I've seen a malformed MSPDI file which sets the parent calendar to itself.",
"// Silently ignore this here.",
"if",
"(",
"calendar",
"!=",
"this",
")",
"{",
"if",
"(",
"getParent",
"(",
")",
... | Sets the ProjectCalendar instance from which this calendar is derived.
@param calendar base calendar instance | [
"Sets",
"the",
"ProjectCalendar",
"instance",
"from",
"which",
"this",
"calendar",
"is",
"derived",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L260-L279 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.isWorkingDay | public boolean isWorkingDay(Day day)
{
DayType value = getWorkingDay(day);
boolean result;
if (value == DayType.DEFAULT)
{
ProjectCalendar cal = getParent();
if (cal != null)
{
result = cal.isWorkingDay(day);
}
else
{
... | java | public boolean isWorkingDay(Day day)
{
DayType value = getWorkingDay(day);
boolean result;
if (value == DayType.DEFAULT)
{
ProjectCalendar cal = getParent();
if (cal != null)
{
result = cal.isWorkingDay(day);
}
else
{
... | [
"public",
"boolean",
"isWorkingDay",
"(",
"Day",
"day",
")",
"{",
"DayType",
"value",
"=",
"getWorkingDay",
"(",
"day",
")",
";",
"boolean",
"result",
";",
"if",
"(",
"value",
"==",
"DayType",
".",
"DEFAULT",
")",
"{",
"ProjectCalendar",
"cal",
"=",
"get... | Method indicating whether a day is a working or non-working day.
@param day required day
@return true if this is a working day | [
"Method",
"indicating",
"whether",
"a",
"day",
"is",
"a",
"working",
"or",
"non",
"-",
"working",
"day",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L292-L315 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getDuration | public Duration getDuration(Date startDate, Date endDate)
{
Calendar cal = DateHelper.popCalendar(startDate);
int days = getDaysInRange(startDate, endDate);
int duration = 0;
Day day = Day.getInstance(cal.get(Calendar.DAY_OF_WEEK));
while (days > 0)
{
if (isWorkingDate(c... | java | public Duration getDuration(Date startDate, Date endDate)
{
Calendar cal = DateHelper.popCalendar(startDate);
int days = getDaysInRange(startDate, endDate);
int duration = 0;
Day day = Day.getInstance(cal.get(Calendar.DAY_OF_WEEK));
while (days > 0)
{
if (isWorkingDate(c... | [
"public",
"Duration",
"getDuration",
"(",
"Date",
"startDate",
",",
"Date",
"endDate",
")",
"{",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
"(",
"startDate",
")",
";",
"int",
"days",
"=",
"getDaysInRange",
"(",
"startDate",
",",
"endDate",
")"... | This method is provided to allow an absolute period of time
represented by start and end dates into a duration in working
days based on this calendar instance. This method takes account
of any exceptions defined for this calendar.
@param startDate start of the period
@param endDate end of the period
@return new Durati... | [
"This",
"method",
"is",
"provided",
"to",
"allow",
"an",
"absolute",
"period",
"of",
"time",
"represented",
"by",
"start",
"and",
"end",
"dates",
"into",
"a",
"duration",
"in",
"working",
"days",
"based",
"on",
"this",
"calendar",
"instance",
".",
"This",
... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L327-L348 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getStartTime | public Date getStartTime(Date date)
{
Date result = m_startTimeCache.get(date);
if (result == null)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, null);
if (ranges == null)
{
result = getParentFile().getProjectProperties().getDefaultStartTime();
... | java | public Date getStartTime(Date date)
{
Date result = m_startTimeCache.get(date);
if (result == null)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, null);
if (ranges == null)
{
result = getParentFile().getProjectProperties().getDefaultStartTime();
... | [
"public",
"Date",
"getStartTime",
"(",
"Date",
"date",
")",
"{",
"Date",
"result",
"=",
"m_startTimeCache",
".",
"get",
"(",
"date",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"ProjectCalendarDateRanges",
"ranges",
"=",
"getRanges",
"(",
"date"... | Retrieves the time at which work starts on the given date, or returns
null if this is a non-working day.
@param date Date instance
@return start time, or null for non-working day | [
"Retrieves",
"the",
"time",
"at",
"which",
"work",
"starts",
"on",
"the",
"given",
"date",
"or",
"returns",
"null",
"if",
"this",
"is",
"a",
"non",
"-",
"working",
"day",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L357-L375 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getFinishTime | public Date getFinishTime(Date date)
{
Date result = null;
if (date != null)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, null);
if (ranges == null)
{
result = getParentFile().getProjectProperties().getDefaultEndTime();
result = Date... | java | public Date getFinishTime(Date date)
{
Date result = null;
if (date != null)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, null);
if (ranges == null)
{
result = getParentFile().getProjectProperties().getDefaultEndTime();
result = Date... | [
"public",
"Date",
"getFinishTime",
"(",
"Date",
"date",
")",
"{",
"Date",
"result",
"=",
"null",
";",
"if",
"(",
"date",
"!=",
"null",
")",
"{",
"ProjectCalendarDateRanges",
"ranges",
"=",
"getRanges",
"(",
"date",
",",
"null",
",",
"null",
")",
";",
"... | Retrieves the time at which work finishes on the given date, or returns
null if this is a non-working day.
@param date Date instance
@return finish time, or null for non-working day | [
"Retrieves",
"the",
"time",
"at",
"which",
"work",
"finishes",
"on",
"the",
"given",
"date",
"or",
"returns",
"null",
"if",
"this",
"is",
"a",
"non",
"-",
"working",
"day",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L384-L416 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.updateToNextWorkStart | private void updateToNextWorkStart(Calendar cal)
{
Date originalDate = cal.getTime();
//
// Find the date ranges for the current day
//
ProjectCalendarDateRanges ranges = getRanges(originalDate, cal, null);
if (ranges != null)
{
//
// Do we have a start t... | java | private void updateToNextWorkStart(Calendar cal)
{
Date originalDate = cal.getTime();
//
// Find the date ranges for the current day
//
ProjectCalendarDateRanges ranges = getRanges(originalDate, cal, null);
if (ranges != null)
{
//
// Do we have a start t... | [
"private",
"void",
"updateToNextWorkStart",
"(",
"Calendar",
"cal",
")",
"{",
"Date",
"originalDate",
"=",
"cal",
".",
"getTime",
"(",
")",
";",
"//",
"// Find the date ranges for the current day",
"//",
"ProjectCalendarDateRanges",
"ranges",
"=",
"getRanges",
"(",
... | This method finds the start of the next working period.
@param cal current Calendar instance | [
"This",
"method",
"finds",
"the",
"start",
"of",
"the",
"next",
"working",
"period",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L770-L838 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getNextWorkStart | public Date getNextWorkStart(Date date)
{
Calendar cal = Calendar.getInstance();
cal.setTime(date);
updateToNextWorkStart(cal);
return cal.getTime();
} | java | public Date getNextWorkStart(Date date)
{
Calendar cal = Calendar.getInstance();
cal.setTime(date);
updateToNextWorkStart(cal);
return cal.getTime();
} | [
"public",
"Date",
"getNextWorkStart",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
";",
"updateToNextWorkStart",
"(",
"cal",
")",
";",
"return",
"cal",
".",... | Utility method to retrieve the next working date start time, given
a date and time as a starting point.
@param date date and time start point
@return date and time of next work start | [
"Utility",
"method",
"to",
"retrieve",
"the",
"next",
"working",
"date",
"start",
"time",
"given",
"a",
"date",
"and",
"time",
"as",
"a",
"starting",
"point",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L913-L919 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getPreviousWorkFinish | public Date getPreviousWorkFinish(Date date)
{
Calendar cal = Calendar.getInstance();
cal.setTime(date);
updateToPreviousWorkFinish(cal);
return cal.getTime();
} | java | public Date getPreviousWorkFinish(Date date)
{
Calendar cal = Calendar.getInstance();
cal.setTime(date);
updateToPreviousWorkFinish(cal);
return cal.getTime();
} | [
"public",
"Date",
"getPreviousWorkFinish",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
";",
"updateToPreviousWorkFinish",
"(",
"cal",
")",
";",
"return",
"ca... | Utility method to retrieve the previous working date finish time, given
a date and time as a starting point.
@param date date and time start point
@return date and time of previous work finish | [
"Utility",
"method",
"to",
"retrieve",
"the",
"previous",
"working",
"date",
"finish",
"time",
"given",
"a",
"date",
"and",
"time",
"as",
"a",
"starting",
"point",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L928-L934 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.isWorkingDate | public boolean isWorkingDate(Date date)
{
Calendar cal = DateHelper.popCalendar(date);
Day day = Day.getInstance(cal.get(Calendar.DAY_OF_WEEK));
DateHelper.pushCalendar(cal);
return isWorkingDate(date, day);
} | java | public boolean isWorkingDate(Date date)
{
Calendar cal = DateHelper.popCalendar(date);
Day day = Day.getInstance(cal.get(Calendar.DAY_OF_WEEK));
DateHelper.pushCalendar(cal);
return isWorkingDate(date, day);
} | [
"public",
"boolean",
"isWorkingDate",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
"(",
"date",
")",
";",
"Day",
"day",
"=",
"Day",
".",
"getInstance",
"(",
"cal",
".",
"get",
"(",
"Calendar",
".",
"DAY_OF_WEEK... | This method allows the caller to determine if a given date is a
working day. This method takes account of calendar exceptions.
@param date Date to be tested
@return boolean value | [
"This",
"method",
"allows",
"the",
"caller",
"to",
"determine",
"if",
"a",
"given",
"date",
"is",
"a",
"working",
"day",
".",
"This",
"method",
"takes",
"account",
"of",
"calendar",
"exceptions",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L943-L949 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.isWorkingDate | private boolean isWorkingDate(Date date, Day day)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, day);
return ranges.getRangeCount() != 0;
} | java | private boolean isWorkingDate(Date date, Day day)
{
ProjectCalendarDateRanges ranges = getRanges(date, null, day);
return ranges.getRangeCount() != 0;
} | [
"private",
"boolean",
"isWorkingDate",
"(",
"Date",
"date",
",",
"Day",
"day",
")",
"{",
"ProjectCalendarDateRanges",
"ranges",
"=",
"getRanges",
"(",
"date",
",",
"null",
",",
"day",
")",
";",
"return",
"ranges",
".",
"getRangeCount",
"(",
")",
"!=",
"0",... | This private method allows the caller to determine if a given date is a
working day. This method takes account of calendar exceptions. It assumes
that the caller has already calculated the day of the week on which
the given day falls.
@param date Date to be tested
@param day Day of the week for the date under test
@re... | [
"This",
"private",
"method",
"allows",
"the",
"caller",
"to",
"determine",
"if",
"a",
"given",
"date",
"is",
"a",
"working",
"day",
".",
"This",
"method",
"takes",
"account",
"of",
"calendar",
"exceptions",
".",
"It",
"assumes",
"that",
"the",
"caller",
"h... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L961-L965 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getDaysInRange | private int getDaysInRange(Date startDate, Date endDate)
{
int result;
Calendar cal = DateHelper.popCalendar(endDate);
int endDateYear = cal.get(Calendar.YEAR);
int endDateDayOfYear = cal.get(Calendar.DAY_OF_YEAR);
cal.setTime(startDate);
if (endDateYear == cal.get(Calendar.YEAR... | java | private int getDaysInRange(Date startDate, Date endDate)
{
int result;
Calendar cal = DateHelper.popCalendar(endDate);
int endDateYear = cal.get(Calendar.YEAR);
int endDateDayOfYear = cal.get(Calendar.DAY_OF_YEAR);
cal.setTime(startDate);
if (endDateYear == cal.get(Calendar.YEAR... | [
"private",
"int",
"getDaysInRange",
"(",
"Date",
"startDate",
",",
"Date",
"endDate",
")",
"{",
"int",
"result",
";",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
"(",
"endDate",
")",
";",
"int",
"endDateYear",
"=",
"cal",
".",
"get",
"(",
"... | This method calculates the absolute number of days between two dates.
Note that where two date objects are provided that fall on the same
day, this method will return one not zero. Note also that this method
assumes that the dates are passed in the correct order, i.e.
startDate < endDate.
@param startDate Start date
@... | [
"This",
"method",
"calculates",
"the",
"absolute",
"number",
"of",
"days",
"between",
"two",
"dates",
".",
"Note",
"that",
"where",
"two",
"date",
"objects",
"are",
"provided",
"that",
"fall",
"on",
"the",
"same",
"day",
"this",
"method",
"will",
"return",
... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L978-L1006 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.setUniqueID | @Override public void setUniqueID(Integer uniqueID)
{
ProjectFile parent = getParentFile();
if (m_uniqueID != null)
{
parent.getCalendars().unmapUniqueID(m_uniqueID);
}
parent.getCalendars().mapUniqueID(uniqueID, this);
m_uniqueID = uniqueID;
} | java | @Override public void setUniqueID(Integer uniqueID)
{
ProjectFile parent = getParentFile();
if (m_uniqueID != null)
{
parent.getCalendars().unmapUniqueID(m_uniqueID);
}
parent.getCalendars().mapUniqueID(uniqueID, this);
m_uniqueID = uniqueID;
} | [
"@",
"Override",
"public",
"void",
"setUniqueID",
"(",
"Integer",
"uniqueID",
")",
"{",
"ProjectFile",
"parent",
"=",
"getParentFile",
"(",
")",
";",
"if",
"(",
"m_uniqueID",
"!=",
"null",
")",
"{",
"parent",
".",
"getCalendars",
"(",
")",
".",
"unmapUniqu... | Modifier method to set the unique ID of this calendar.
@param uniqueID unique identifier | [
"Modifier",
"method",
"to",
"set",
"the",
"unique",
"ID",
"of",
"this",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1013-L1025 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.setResource | public void setResource(Resource resource)
{
m_resource = resource;
String name = m_resource.getName();
if (name == null || name.length() == 0)
{
name = "Unnamed Resource";
}
setName(name);
} | java | public void setResource(Resource resource)
{
m_resource = resource;
String name = m_resource.getName();
if (name == null || name.length() == 0)
{
name = "Unnamed Resource";
}
setName(name);
} | [
"public",
"void",
"setResource",
"(",
"Resource",
"resource",
")",
"{",
"m_resource",
"=",
"resource",
";",
"String",
"name",
"=",
"m_resource",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"=="... | Sets the resource to which this calendar is linked. Note that this
method updates the calendar's name to be the same as the resource name.
If the resource does not yet have a name, then the calendar is given
a default name.
@param resource resource instance | [
"Sets",
"the",
"resource",
"to",
"which",
"this",
"calendar",
"is",
"linked",
".",
"Note",
"that",
"this",
"method",
"updates",
"the",
"calendar",
"s",
"name",
"to",
"be",
"the",
"same",
"as",
"the",
"resource",
"name",
".",
"If",
"the",
"resource",
"doe... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1055-L1064 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.