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/ResourceAssignment.java
ResourceAssignment.getTimephasedBaselineCost
public List<TimephasedCost> getTimephasedBaselineCost(int index) { return m_timephasedBaselineCost[index] == null ? null : m_timephasedBaselineCost[index].getData(); }
java
public List<TimephasedCost> getTimephasedBaselineCost(int index) { return m_timephasedBaselineCost[index] == null ? null : m_timephasedBaselineCost[index].getData(); }
[ "public", "List", "<", "TimephasedCost", ">", "getTimephasedBaselineCost", "(", "int", "index", ")", "{", "return", "m_timephasedBaselineCost", "[", "index", "]", "==", "null", "?", "null", ":", "m_timephasedBaselineCost", "[", "index", "]", ".", "getData", "(",...
Retrieve timephased baseline cost. Note that index 0 represents "Baseline", index 1 represents "Baseline1" and so on. @param index baseline index @return timephased work, or null if no baseline is present
[ "Retrieve", "timephased", "baseline", "cost", ".", "Note", "that", "index", "0", "represents", "Baseline", "index", "1", "represents", "Baseline1", "and", "so", "on", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1232-L1235
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getCalendar
public ProjectCalendar getCalendar() { ProjectCalendar calendar = null; Resource resource = getResource(); if (resource != null) { calendar = resource.getResourceCalendar(); } Task task = getTask(); if (calendar == null || task.getIgnoreResourceCalendar()) { ...
java
public ProjectCalendar getCalendar() { ProjectCalendar calendar = null; Resource resource = getResource(); if (resource != null) { calendar = resource.getResourceCalendar(); } Task task = getTask(); if (calendar == null || task.getIgnoreResourceCalendar()) { ...
[ "public", "ProjectCalendar", "getCalendar", "(", ")", "{", "ProjectCalendar", "calendar", "=", "null", ";", "Resource", "resource", "=", "getResource", "(", ")", ";", "if", "(", "resource", "!=", "null", ")", "{", "calendar", "=", "resource", ".", "getResour...
Retrieves the calendar used for this resource assignment. @return ProjectCalendar instance
[ "Retrieves", "the", "calendar", "used", "for", "this", "resource", "assignment", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1242-L1258
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setEnterpriseCost
public void setEnterpriseCost(int index, Number value) { set(selectField(AssignmentFieldLists.ENTERPRISE_COST, index), value); }
java
public void setEnterpriseCost(int index, Number value) { set(selectField(AssignmentFieldLists.ENTERPRISE_COST, index), value); }
[ "public", "void", "setEnterpriseCost", "(", "int", "index", ",", "Number", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "ENTERPRISE_COST", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise cost value. @param index cost index (1-30) @param value cost value
[ "Set", "an", "enterprise", "cost", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1694-L1697
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setEnterpriseDate
public void setEnterpriseDate(int index, Date value) { set(selectField(AssignmentFieldLists.ENTERPRISE_DATE, index), value); }
java
public void setEnterpriseDate(int index, Date value) { set(selectField(AssignmentFieldLists.ENTERPRISE_DATE, index), value); }
[ "public", "void", "setEnterpriseDate", "(", "int", "index", ",", "Date", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "ENTERPRISE_DATE", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise date value. @param index date index (1-30) @param value date value
[ "Set", "an", "enterprise", "date", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1716-L1719
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setEnterpriseDuration
public void setEnterpriseDuration(int index, Duration value) { set(selectField(AssignmentFieldLists.ENTERPRISE_DURATION, index), value); }
java
public void setEnterpriseDuration(int index, Duration value) { set(selectField(AssignmentFieldLists.ENTERPRISE_DURATION, index), value); }
[ "public", "void", "setEnterpriseDuration", "(", "int", "index", ",", "Duration", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "ENTERPRISE_DURATION", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise duration value. @param index duration index (1-30) @param value duration value
[ "Set", "an", "enterprise", "duration", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1738-L1741
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setEnterpriseNumber
public void setEnterpriseNumber(int index, Number value) { set(selectField(AssignmentFieldLists.ENTERPRISE_NUMBER, index), value); }
java
public void setEnterpriseNumber(int index, Number value) { set(selectField(AssignmentFieldLists.ENTERPRISE_NUMBER, index), value); }
[ "public", "void", "setEnterpriseNumber", "(", "int", "index", ",", "Number", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "ENTERPRISE_NUMBER", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise number value. @param index number index (1-40) @param value number value
[ "Set", "an", "enterprise", "number", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1782-L1785
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.setEnterpriseText
public void setEnterpriseText(int index, String value) { set(selectField(AssignmentFieldLists.ENTERPRISE_TEXT, index), value); }
java
public void setEnterpriseText(int index, String value) { set(selectField(AssignmentFieldLists.ENTERPRISE_TEXT, index), value); }
[ "public", "void", "setEnterpriseText", "(", "int", "index", ",", "String", "value", ")", "{", "set", "(", "selectField", "(", "AssignmentFieldLists", ".", "ENTERPRISE_TEXT", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise text value. @param index text index (1-40) @param value text value
[ "Set", "an", "enterprise", "text", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1804-L1807
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getOvertimeCost
public Number getOvertimeCost() { Number cost = (Number) getCachedValue(AssignmentField.OVERTIME_COST); if (cost == null) { Number actual = getActualOvertimeCost(); Number remaining = getRemainingOvertimeCost(); if (actual != null && remaining != null) { ...
java
public Number getOvertimeCost() { Number cost = (Number) getCachedValue(AssignmentField.OVERTIME_COST); if (cost == null) { Number actual = getActualOvertimeCost(); Number remaining = getRemainingOvertimeCost(); if (actual != null && remaining != null) { ...
[ "public", "Number", "getOvertimeCost", "(", ")", "{", "Number", "cost", "=", "(", "Number", ")", "getCachedValue", "(", "AssignmentField", ".", "OVERTIME_COST", ")", ";", "if", "(", "cost", "==", "null", ")", "{", "Number", "actual", "=", "getActualOvertimeC...
Returns the overtime cost of this resource assignment. @return cost
[ "Returns", "the", "overtime", "cost", "of", "this", "resource", "assignment", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1907-L1921
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getPercentageWorkComplete
public Number getPercentageWorkComplete() { Number pct = (Number) getCachedValue(AssignmentField.PERCENT_WORK_COMPLETE); if (pct == null) { Duration actualWork = getActualWork(); Duration work = getWork(); if (actualWork != null && work != null && work.getDuration() != 0)...
java
public Number getPercentageWorkComplete() { Number pct = (Number) getCachedValue(AssignmentField.PERCENT_WORK_COMPLETE); if (pct == null) { Duration actualWork = getActualWork(); Duration work = getWork(); if (actualWork != null && work != null && work.getDuration() != 0)...
[ "public", "Number", "getPercentageWorkComplete", "(", ")", "{", "Number", "pct", "=", "(", "Number", ")", "getCachedValue", "(", "AssignmentField", ".", "PERCENT_WORK_COMPLETE", ")", ";", "if", "(", "pct", "==", "null", ")", "{", "Duration", "actualWork", "=",...
The % Work Complete field contains the current status of a task, expressed as the percentage of the task's work that has been completed. You can enter percent work complete, or you can have Microsoft Project calculate it for you based on actual work on the task. @return percentage as float
[ "The", "%", "Work", "Complete", "field", "contains", "the", "current", "status", "of", "a", "task", "expressed", "as", "the", "percentage", "of", "the", "task", "s", "work", "that", "has", "been", "completed", ".", "You", "can", "enter", "percent", "work",...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2198-L2212
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getStartVariance
public Duration getStartVariance() { Duration variance = (Duration) getCachedValue(AssignmentField.START_VARIANCE); if (variance == null) { TimeUnit format = getParentFile().getProjectProperties().getDefaultDurationUnits(); variance = DateHelper.getVariance(getTask(), getBaselineS...
java
public Duration getStartVariance() { Duration variance = (Duration) getCachedValue(AssignmentField.START_VARIANCE); if (variance == null) { TimeUnit format = getParentFile().getProjectProperties().getDefaultDurationUnits(); variance = DateHelper.getVariance(getTask(), getBaselineS...
[ "public", "Duration", "getStartVariance", "(", ")", "{", "Duration", "variance", "=", "(", "Duration", ")", "getCachedValue", "(", "AssignmentField", ".", "START_VARIANCE", ")", ";", "if", "(", "variance", "==", "null", ")", "{", "TimeUnit", "format", "=", "...
Calculate the start variance. @return start variance
[ "Calculate", "the", "start", "variance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2418-L2428
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getFinishVariance
public Duration getFinishVariance() { Duration variance = (Duration) getCachedValue(AssignmentField.FINISH_VARIANCE); if (variance == null) { TimeUnit format = getParentFile().getProjectProperties().getDefaultDurationUnits(); variance = DateHelper.getVariance(getTask(), getBaselin...
java
public Duration getFinishVariance() { Duration variance = (Duration) getCachedValue(AssignmentField.FINISH_VARIANCE); if (variance == null) { TimeUnit format = getParentFile().getProjectProperties().getDefaultDurationUnits(); variance = DateHelper.getVariance(getTask(), getBaselin...
[ "public", "Duration", "getFinishVariance", "(", ")", "{", "Duration", "variance", "=", "(", "Duration", ")", "getCachedValue", "(", "AssignmentField", ".", "FINISH_VARIANCE", ")", ";", "if", "(", "variance", "==", "null", ")", "{", "TimeUnit", "format", "=", ...
Calculate the finish variance. @return finish variance
[ "Calculate", "the", "finish", "variance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2447-L2457
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.getCostRateTableIndex
public int getCostRateTableIndex() { Integer value = (Integer) getCachedValue(AssignmentField.COST_RATE_TABLE); return value == null ? 0 : value.intValue(); }
java
public int getCostRateTableIndex() { Integer value = (Integer) getCachedValue(AssignmentField.COST_RATE_TABLE); return value == null ? 0 : value.intValue(); }
[ "public", "int", "getCostRateTableIndex", "(", ")", "{", "Integer", "value", "=", "(", "Integer", ")", "getCachedValue", "(", "AssignmentField", ".", "COST_RATE_TABLE", ")", ";", "return", "value", "==", "null", "?", "0", ":", "value", ".", "intValue", "(", ...
Returns the cost rate table index for this assignment. @return cost rate table index
[ "Returns", "the", "cost", "rate", "table", "index", "for", "this", "assignment", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2580-L2584
train
joniles/mpxj
src/main/java/net/sf/mpxj/ResourceAssignment.java
ResourceAssignment.selectField
private AssignmentField selectField(AssignmentField[] fields, int index) { if (index < 1 || index > fields.length) { throw new IllegalArgumentException(index + " is not a valid field index"); } return (fields[index - 1]); }
java
private AssignmentField selectField(AssignmentField[] fields, int index) { if (index < 1 || index > fields.length) { throw new IllegalArgumentException(index + " is not a valid field index"); } return (fields[index - 1]); }
[ "private", "AssignmentField", "selectField", "(", "AssignmentField", "[", "]", "fields", ",", "int", "index", ")", "{", "if", "(", "index", "<", "1", "||", "index", ">", "fields", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "i...
Maps a field index to an AssignmentField instance. @param fields array of fields used as the basis for the mapping. @param index required field index @return AssignmnetField instance
[ "Maps", "a", "field", "index", "to", "an", "AssignmentField", "instance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2683-L2690
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/ActivitySorter.java
ActivitySorter.sort
public void sort(ChildTaskContainer container) { // Do we have any tasks? List<Task> tasks = container.getChildTasks(); if (!tasks.isEmpty()) { for (Task task : tasks) { // // Sort child activities // sort(task); /...
java
public void sort(ChildTaskContainer container) { // Do we have any tasks? List<Task> tasks = container.getChildTasks(); if (!tasks.isEmpty()) { for (Task task : tasks) { // // Sort child activities // sort(task); /...
[ "public", "void", "sort", "(", "ChildTaskContainer", "container", ")", "{", "// Do we have any tasks?", "List", "<", "Task", ">", "tasks", "=", "container", ".", "getChildTasks", "(", ")", ";", "if", "(", "!", "tasks", ".", "isEmpty", "(", ")", ")", "{", ...
Recursively sort the supplied child tasks. @param container child tasks
[ "Recursively", "sort", "the", "supplied", "child", "tasks", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/ActivitySorter.java#L57-L110
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/p3/TableReader.java
TableReader.read
public void read(File file, Table table) throws IOException { //System.out.println("Reading " + file.getName()); InputStream is = null; try { is = new FileInputStream(file); read(is, table); } finally { StreamHelper.closeQuietly(is); } }
java
public void read(File file, Table table) throws IOException { //System.out.println("Reading " + file.getName()); InputStream is = null; try { is = new FileInputStream(file); read(is, table); } finally { StreamHelper.closeQuietly(is); } }
[ "public", "void", "read", "(", "File", "file", ",", "Table", "table", ")", "throws", "IOException", "{", "//System.out.println(\"Reading \" + file.getName());", "InputStream", "is", "=", "null", ";", "try", "{", "is", "=", "new", "FileInputStream", "(", "file", ...
Read the table from the file and populate the supplied Table instance. @param file database file @param table Table instance
[ "Read", "the", "table", "from", "the", "file", "and", "populate", "the", "supplied", "Table", "instance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/p3/TableReader.java#L60-L74
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/p3/TableReader.java
TableReader.readPage
private void readPage(byte[] buffer, Table table) { int magicNumber = getShort(buffer, 0); if (magicNumber == 0x4400) { //System.out.println(ByteArrayHelper.hexdump(buffer, 0, 6, true, 16, "")); int recordSize = m_definition.getRecordSize(); RowValidator rowValidator = m_...
java
private void readPage(byte[] buffer, Table table) { int magicNumber = getShort(buffer, 0); if (magicNumber == 0x4400) { //System.out.println(ByteArrayHelper.hexdump(buffer, 0, 6, true, 16, "")); int recordSize = m_definition.getRecordSize(); RowValidator rowValidator = m_...
[ "private", "void", "readPage", "(", "byte", "[", "]", "buffer", ",", "Table", "table", ")", "{", "int", "magicNumber", "=", "getShort", "(", "buffer", ",", "0", ")", ";", "if", "(", "magicNumber", "==", "0x4400", ")", "{", "//System.out.println(ByteArrayHe...
Reads data from a single page of the database file. @param buffer page from the database file @param table Table instance
[ "Reads", "data", "from", "a", "single", "page", "of", "the", "database", "file", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/p3/TableReader.java#L108-L142
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/PropsBlock.java
PropsBlock.populateMap
private void populateMap(byte[] data, Integer previousItemOffset, Integer previousItemKey, Integer itemOffset) { if (previousItemOffset != null) { int itemSize = itemOffset.intValue() - previousItemOffset.intValue(); byte[] itemData = new byte[itemSize]; System.arraycopy(data, ...
java
private void populateMap(byte[] data, Integer previousItemOffset, Integer previousItemKey, Integer itemOffset) { if (previousItemOffset != null) { int itemSize = itemOffset.intValue() - previousItemOffset.intValue(); byte[] itemData = new byte[itemSize]; System.arraycopy(data, ...
[ "private", "void", "populateMap", "(", "byte", "[", "]", "data", ",", "Integer", "previousItemOffset", ",", "Integer", "previousItemKey", ",", "Integer", "itemOffset", ")", "{", "if", "(", "previousItemOffset", "!=", "null", ")", "{", "int", "itemSize", "=", ...
Method used to extract data from the block of properties and insert the key value pair into a map. @param data block of property data @param previousItemOffset previous offset @param previousItemKey item key @param itemOffset current item offset
[ "Method", "used", "to", "extract", "data", "from", "the", "block", "of", "properties", "and", "insert", "the", "key", "value", "pair", "into", "a", "map", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/PropsBlock.java#L83-L92
train
joniles/mpxj
src/main/java/net/sf/mpxj/explorer/HexDumpController.java
HexDumpController.viewDocument
public void viewDocument(DocumentEntry entry) { InputStream is = null; try { is = new DocumentInputStream(entry); byte[] data = new byte[is.available()]; is.read(data); m_model.setData(data); updateTables(); } catch (IOException ex) {...
java
public void viewDocument(DocumentEntry entry) { InputStream is = null; try { is = new DocumentInputStream(entry); byte[] data = new byte[is.available()]; is.read(data); m_model.setData(data); updateTables(); } catch (IOException ex) {...
[ "public", "void", "viewDocument", "(", "DocumentEntry", "entry", ")", "{", "InputStream", "is", "=", "null", ";", "try", "{", "is", "=", "new", "DocumentInputStream", "(", "entry", ")", ";", "byte", "[", "]", "data", "=", "new", "byte", "[", "is", ".",...
Command to select a document from the POIFS for viewing. @param entry document to view
[ "Command", "to", "select", "a", "document", "from", "the", "POIFS", "for", "viewing", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/HexDumpController.java#L112-L135
train
joniles/mpxj
src/main/java/net/sf/mpxj/explorer/HexDumpController.java
HexDumpController.updateTables
protected void updateTables() { byte[] data = m_model.getData(); int columns = m_model.getColumns(); int rows = (data.length / columns) + 1; int offset = m_model.getOffset(); String[][] hexData = new String[rows][columns]; String[][] asciiData = new String[rows][columns]; ...
java
protected void updateTables() { byte[] data = m_model.getData(); int columns = m_model.getColumns(); int rows = (data.length / columns) + 1; int offset = m_model.getOffset(); String[][] hexData = new String[rows][columns]; String[][] asciiData = new String[rows][columns]; ...
[ "protected", "void", "updateTables", "(", ")", "{", "byte", "[", "]", "data", "=", "m_model", ".", "getData", "(", ")", ";", "int", "columns", "=", "m_model", ".", "getColumns", "(", ")", ";", "int", "rows", "=", "(", "data", ".", "length", "/", "c...
Update the content of the tables.
[ "Update", "the", "content", "of", "the", "tables", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/HexDumpController.java#L140-L199
train
joniles/mpxj
src/main/java/net/sf/mpxj/common/FieldTypeHelper.java
FieldTypeHelper.getInstance
public static final FieldType getInstance(int fieldID) { FieldType result; int prefix = fieldID & 0xFFFF0000; int index = fieldID & 0x0000FFFF; switch (prefix) { case MPPTaskField.TASK_FIELD_BASE: { result = MPPTaskField.getInstance(index); if ...
java
public static final FieldType getInstance(int fieldID) { FieldType result; int prefix = fieldID & 0xFFFF0000; int index = fieldID & 0x0000FFFF; switch (prefix) { case MPPTaskField.TASK_FIELD_BASE: { result = MPPTaskField.getInstance(index); if ...
[ "public", "static", "final", "FieldType", "getInstance", "(", "int", "fieldID", ")", "{", "FieldType", "result", ";", "int", "prefix", "=", "fieldID", "&", "0xFFFF0000", ";", "int", "index", "=", "fieldID", "&", "0x0000FFFF", ";", "switch", "(", "prefix", ...
Retrieve a FieldType instance based on an ID value from an MPP9 or MPP12 file. @param fieldID field ID @return FieldType instance
[ "Retrieve", "a", "FieldType", "instance", "based", "on", "an", "ID", "value", "from", "an", "MPP9", "or", "MPP12", "file", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/FieldTypeHelper.java#L87-L143
train
joniles/mpxj
src/main/java/net/sf/mpxj/common/FieldTypeHelper.java
FieldTypeHelper.getPlaceholder
private static FieldType getPlaceholder(final Class<?> type, final int fieldID) { return new FieldType() { @Override public FieldTypeClass getFieldTypeClass() { return FieldTypeClass.UNKNOWN; } @Override public String name() { return "...
java
private static FieldType getPlaceholder(final Class<?> type, final int fieldID) { return new FieldType() { @Override public FieldTypeClass getFieldTypeClass() { return FieldTypeClass.UNKNOWN; } @Override public String name() { return "...
[ "private", "static", "FieldType", "getPlaceholder", "(", "final", "Class", "<", "?", ">", "type", ",", "final", "int", "fieldID", ")", "{", "return", "new", "FieldType", "(", ")", "{", "@", "Override", "public", "FieldTypeClass", "getFieldTypeClass", "(", ")...
Generate a placeholder for an unknown type. @param type expected type @param fieldID field ID @return placeholder
[ "Generate", "a", "placeholder", "for", "an", "unknown", "type", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/FieldTypeHelper.java#L218-L262
train
joniles/mpxj
src/main/java/net/sf/mpxj/common/FieldTypeHelper.java
FieldTypeHelper.valueIsNotDefault
public static final boolean valueIsNotDefault(FieldType type, Object value) { boolean result = true; if (value == null) { result = false; } else { DataType dataType = type.getDataType(); switch (dataType) { case BOOLEAN: ...
java
public static final boolean valueIsNotDefault(FieldType type, Object value) { boolean result = true; if (value == null) { result = false; } else { DataType dataType = type.getDataType(); switch (dataType) { case BOOLEAN: ...
[ "public", "static", "final", "boolean", "valueIsNotDefault", "(", "FieldType", "type", ",", "Object", "value", ")", "{", "boolean", "result", "=", "true", ";", "if", "(", "value", "==", "null", ")", "{", "result", "=", "false", ";", "}", "else", "{", "...
Determines if this value is the default value for the given field type. @param type field type @param value value @return true if the value is not default
[ "Determines", "if", "this", "value", "is", "the", "default", "value", "for", "the", "given", "field", "type", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/FieldTypeHelper.java#L313-L353
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.readAll
public List<ProjectFile> readAll(InputStream is, boolean linkCrossProjectRelations) throws MPXJException { try { m_tables = new HashMap<String, List<Row>>(); m_numberFormat = new DecimalFormat(); processFile(is); List<Row> rows = getRows("project", null, null); ...
java
public List<ProjectFile> readAll(InputStream is, boolean linkCrossProjectRelations) throws MPXJException { try { m_tables = new HashMap<String, List<Row>>(); m_numberFormat = new DecimalFormat(); processFile(is); List<Row> rows = getRows("project", null, null); ...
[ "public", "List", "<", "ProjectFile", ">", "readAll", "(", "InputStream", "is", ",", "boolean", "linkCrossProjectRelations", ")", "throws", "MPXJException", "{", "try", "{", "m_tables", "=", "new", "HashMap", "<", "String", ",", "List", "<", "Row", ">", ">",...
This is a convenience method which allows all projects in an XER file to be read in a single pass. @param is input stream @param linkCrossProjectRelations add Relation links that cross ProjectFile boundaries @return list of ProjectFile instances @throws MPXJException
[ "This", "is", "a", "convenience", "method", "which", "allows", "all", "projects", "in", "an", "XER", "file", "to", "be", "read", "in", "a", "single", "pass", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L177-L250
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.processFile
private void processFile(InputStream is) throws MPXJException { int line = 1; try { // // Test the header and extract the separator. If this is successful, // we reset the stream back as far as we can. The design of the // BufferedInputStream class means that we...
java
private void processFile(InputStream is) throws MPXJException { int line = 1; try { // // Test the header and extract the separator. If this is successful, // we reset the stream back as far as we can. The design of the // BufferedInputStream class means that we...
[ "private", "void", "processFile", "(", "InputStream", "is", ")", "throws", "MPXJException", "{", "int", "line", "=", "1", ";", "try", "{", "//", "// Test the header and extract the separator. If this is successful,", "// we reset the stream back as far as we can. The design of ...
Reads the XER file table and row structure ready for processing. @param is input stream @throws MPXJException
[ "Reads", "the", "XER", "file", "table", "and", "row", "structure", "ready", "for", "processing", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L258-L307
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.getCharset
private Charset getCharset() { Charset result = m_charset; if (result == null) { // We default to CP1252 as this seems to be the most common encoding result = m_encoding == null ? CharsetHelper.CP1252 : Charset.forName(m_encoding); } return result; }
java
private Charset getCharset() { Charset result = m_charset; if (result == null) { // We default to CP1252 as this seems to be the most common encoding result = m_encoding == null ? CharsetHelper.CP1252 : Charset.forName(m_encoding); } return result; }
[ "private", "Charset", "getCharset", "(", ")", "{", "Charset", "result", "=", "m_charset", ";", "if", "(", "result", "==", "null", ")", "{", "// We default to CP1252 as this seems to be the most common encoding", "result", "=", "m_encoding", "==", "null", "?", "Chars...
Retrieve the Charset used to read the file. @return Charset instance
[ "Retrieve", "the", "Charset", "used", "to", "read", "the", "file", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L314-L323
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.processProjectID
private void processProjectID() { if (m_projectID == null) { List<Row> rows = getRows("project", null, null); if (!rows.isEmpty()) { Row row = rows.get(0); m_projectID = row.getInteger("proj_id"); } } }
java
private void processProjectID() { if (m_projectID == null) { List<Row> rows = getRows("project", null, null); if (!rows.isEmpty()) { Row row = rows.get(0); m_projectID = row.getInteger("proj_id"); } } }
[ "private", "void", "processProjectID", "(", ")", "{", "if", "(", "m_projectID", "==", "null", ")", "{", "List", "<", "Row", ">", "rows", "=", "getRows", "(", "\"project\"", ",", "null", ",", "null", ")", ";", "if", "(", "!", "rows", ".", "isEmpty", ...
If the user has not specified a project ID, this method retrieves the ID of the first project in the file.
[ "If", "the", "user", "has", "not", "specified", "a", "project", "ID", "this", "method", "retrieves", "the", "ID", "of", "the", "first", "project", "in", "the", "file", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L329-L340
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.processCurrency
private void processCurrency(Row row) { String currencyName = row.getString("curr_short_name"); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator(row.getString("decimal_symbol").charAt(0)); symbols.setGroupingSeparator(row.getString("digit_group_symbol").c...
java
private void processCurrency(Row row) { String currencyName = row.getString("curr_short_name"); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator(row.getString("decimal_symbol").charAt(0)); symbols.setGroupingSeparator(row.getString("digit_group_symbol").c...
[ "private", "void", "processCurrency", "(", "Row", "row", ")", "{", "String", "currencyName", "=", "row", ".", "getString", "(", "\"curr_short_name\"", ")", ";", "DecimalFormatSymbols", "symbols", "=", "new", "DecimalFormatSymbols", "(", ")", ";", "symbols", ".",...
Process a currency definition. @param row record from XER file
[ "Process", "a", "currency", "definition", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L347-L363
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.listProjects
public Map<Integer, String> listProjects(InputStream is) throws MPXJException { try { m_tables = new HashMap<String, List<Row>>(); processFile(is); Map<Integer, String> result = new HashMap<Integer, String>(); List<Row> rows = getRows("project", null, null); ...
java
public Map<Integer, String> listProjects(InputStream is) throws MPXJException { try { m_tables = new HashMap<String, List<Row>>(); processFile(is); Map<Integer, String> result = new HashMap<Integer, String>(); List<Row> rows = getRows("project", null, null); ...
[ "public", "Map", "<", "Integer", ",", "String", ">", "listProjects", "(", "InputStream", "is", ")", "throws", "MPXJException", "{", "try", "{", "m_tables", "=", "new", "HashMap", "<", "String", ",", "List", "<", "Row", ">", ">", "(", ")", ";", "process...
Populates a Map instance representing the IDs and names of projects available in the current file. @param is input stream used to read XER file @return Map instance containing ID and name pairs @throws MPXJException
[ "Populates", "a", "Map", "instance", "representing", "the", "IDs", "and", "names", "of", "projects", "available", "in", "the", "current", "file", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L373-L399
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.processScheduleOptions
private void processScheduleOptions() { List<Row> rows = getRows("schedoptions", "proj_id", m_projectID); if (rows.isEmpty() == false) { Row row = rows.get(0); Map<String, Object> customProperties = new HashMap<String, Object>(); customProperties.put("LagCalendar", row.ge...
java
private void processScheduleOptions() { List<Row> rows = getRows("schedoptions", "proj_id", m_projectID); if (rows.isEmpty() == false) { Row row = rows.get(0); Map<String, Object> customProperties = new HashMap<String, Object>(); customProperties.put("LagCalendar", row.ge...
[ "private", "void", "processScheduleOptions", "(", ")", "{", "List", "<", "Row", ">", "rows", "=", "getRows", "(", "\"schedoptions\"", ",", "\"proj_id\"", ",", "m_projectID", ")", ";", "if", "(", "rows", ".", "isEmpty", "(", ")", "==", "false", ")", "{", ...
Process schedule options from SCHEDOPTIONS. This table only seems to exist in XER files, not P6 databases.
[ "Process", "schedule", "options", "from", "SCHEDOPTIONS", ".", "This", "table", "only", "seems", "to", "exist", "in", "XER", "files", "not", "P6", "databases", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L438-L452
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.readRecord
private void readRecord(Tokenizer tk, List<String> record) throws IOException { record.clear(); while (tk.nextToken() == Tokenizer.TT_WORD) { record.add(tk.getToken()); } }
java
private void readRecord(Tokenizer tk, List<String> record) throws IOException { record.clear(); while (tk.nextToken() == Tokenizer.TT_WORD) { record.add(tk.getToken()); } }
[ "private", "void", "readRecord", "(", "Tokenizer", "tk", ",", "List", "<", "String", ">", "record", ")", "throws", "IOException", "{", "record", ".", "clear", "(", ")", ";", "while", "(", "tk", ".", "nextToken", "(", ")", "==", "Tokenizer", ".", "TT_WO...
Reads each token from a single record and adds it to a list. @param tk tokenizer @param record list of tokens @throws IOException
[ "Reads", "each", "token", "from", "a", "single", "record", "and", "adds", "it", "to", "a", "list", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L529-L536
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.processRecord
private boolean processRecord(List<String> record) throws MPXJException { boolean done = false; XerRecordType type = RECORD_TYPE_MAP.get(record.get(0)); if (type == null) { throw new MPXJException(MPXJException.INVALID_FORMAT); } switch (type) { case HEAD...
java
private boolean processRecord(List<String> record) throws MPXJException { boolean done = false; XerRecordType type = RECORD_TYPE_MAP.get(record.get(0)); if (type == null) { throw new MPXJException(MPXJException.INVALID_FORMAT); } switch (type) { case HEAD...
[ "private", "boolean", "processRecord", "(", "List", "<", "String", ">", "record", ")", "throws", "MPXJException", "{", "boolean", "done", "=", "false", ";", "XerRecordType", "type", "=", "RECORD_TYPE_MAP", ".", "get", "(", "record", ".", "get", "(", "0", "...
Handles a complete record at a time, stores it in a form ready for further processing. @param record record to be processed @return flag indicating if this is the last record in the file to be processed @throws MPXJException
[ "Handles", "a", "complete", "record", "at", "a", "time", "stores", "it", "in", "a", "form", "ready", "for", "further", "processing", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L546-L698
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java
PrimaveraXERFileReader.getRows
private List<Row> getRows(String tableName, String columnName, Integer id) { List<Row> result; List<Row> table = m_tables.get(tableName); if (table == null) { result = Collections.<Row> emptyList(); } else { if (columnName == null) { re...
java
private List<Row> getRows(String tableName, String columnName, Integer id) { List<Row> result; List<Row> table = m_tables.get(tableName); if (table == null) { result = Collections.<Row> emptyList(); } else { if (columnName == null) { re...
[ "private", "List", "<", "Row", ">", "getRows", "(", "String", "tableName", ",", "String", "columnName", ",", "Integer", "id", ")", "{", "List", "<", "Row", ">", "result", ";", "List", "<", "Row", ">", "table", "=", "m_tables", ".", "get", "(", "table...
Filters a list of rows from the named table. If a column name and a value are supplied, then use this to filter the rows. If no column name is supplied, then return all rows. @param tableName table name @param columnName filter column name @param id filter column value @return filtered list of rows
[ "Filters", "a", "list", "of", "rows", "from", "the", "named", "table", ".", "If", "a", "column", "name", "and", "a", "value", "are", "supplied", "then", "use", "this", "to", "filter", "the", "rows", ".", "If", "no", "column", "name", "is", "supplied", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L803-L830
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader.java
CustomFieldValueReader.getTypedValue
protected Object getTypedValue(int type, byte[] value) { Object result; switch (type) { case 4: // Date { result = MPPUtility.getTimestamp(value, 0); break; } case 6: // Duration { TimeUnit units = MPPUtility.getDura...
java
protected Object getTypedValue(int type, byte[] value) { Object result; switch (type) { case 4: // Date { result = MPPUtility.getTimestamp(value, 0); break; } case 6: // Duration { TimeUnit units = MPPUtility.getDura...
[ "protected", "Object", "getTypedValue", "(", "int", "type", ",", "byte", "[", "]", "value", ")", "{", "Object", "result", ";", "switch", "(", "type", ")", "{", "case", "4", ":", "// Date", "{", "result", "=", "MPPUtility", ".", "getTimestamp", "(", "va...
Convert raw value as read from the MPP file into a Java type. @param type MPP value type @param value raw value data @return Java object
[ "Convert", "raw", "value", "as", "read", "from", "the", "MPP", "file", "into", "a", "Java", "type", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader.java#L71-L117
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/common/Table.java
Table.addRow
public void addRow(String primaryKeyColumnName, Map<String, Object> map) { Integer rowNumber = Integer.valueOf(m_rowNumber++); map.put("ROW_NUMBER", rowNumber); Object primaryKey = null; if (primaryKeyColumnName != null) { primaryKey = map.get(primaryKeyColumnName); } ...
java
public void addRow(String primaryKeyColumnName, Map<String, Object> map) { Integer rowNumber = Integer.valueOf(m_rowNumber++); map.put("ROW_NUMBER", rowNumber); Object primaryKey = null; if (primaryKeyColumnName != null) { primaryKey = map.get(primaryKeyColumnName); } ...
[ "public", "void", "addRow", "(", "String", "primaryKeyColumnName", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "Integer", "rowNumber", "=", "Integer", ".", "valueOf", "(", "m_rowNumber", "++", ")", ";", "map", ".", "put", "(", "\"ROW_...
Add a row to the table. We have a limited understanding of the way Btrieve handles outdated rows, so we use what we think is a version number to try to ensure that we only have the latest rows. @param primaryKeyColumnName primary key column name @param map Map containing row data
[ "Add", "a", "row", "to", "the", "table", ".", "We", "have", "a", "limited", "understanding", "of", "the", "way", "Btrieve", "handles", "outdated", "rows", "so", "we", "use", "what", "we", "think", "is", "a", "version", "number", "to", "try", "to", "ens...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/common/Table.java#L63-L93
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.getEmbeddedObjects
public static List<List<RTFEmbeddedObject>> getEmbeddedObjects(String text) { List<List<RTFEmbeddedObject>> objects = null; List<RTFEmbeddedObject> objectData; int offset = text.indexOf(OBJDATA); if (offset != -1) { objects = new LinkedList<List<RTFEmbeddedObject>>(); ...
java
public static List<List<RTFEmbeddedObject>> getEmbeddedObjects(String text) { List<List<RTFEmbeddedObject>> objects = null; List<RTFEmbeddedObject> objectData; int offset = text.indexOf(OBJDATA); if (offset != -1) { objects = new LinkedList<List<RTFEmbeddedObject>>(); ...
[ "public", "static", "List", "<", "List", "<", "RTFEmbeddedObject", ">", ">", "getEmbeddedObjects", "(", "String", "text", ")", "{", "List", "<", "List", "<", "RTFEmbeddedObject", ">>", "objects", "=", "null", ";", "List", "<", "RTFEmbeddedObject", ">", "obje...
This method generates a list of lists. Each list represents the data for an embedded object, and contains set set of RTFEmbeddedObject instances that make up the embedded object. This method will return null if there are no embedded objects in the RTF document. @param text RTF document @return list of lists of RTFEmbe...
[ "This", "method", "generates", "a", "list", "of", "lists", ".", "Each", "list", "represents", "the", "data", "for", "an", "embedded", "object", "and", "contains", "set", "set", "of", "RTFEmbeddedObject", "instances", "that", "make", "up", "the", "embedded", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L149-L169
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.getInt
private int getInt(List<byte[]> blocks) { int result; if (blocks.isEmpty() == false) { byte[] data = blocks.remove(0); result = MPPUtility.getInt(data, 0); } else { result = 0; } return (result); }
java
private int getInt(List<byte[]> blocks) { int result; if (blocks.isEmpty() == false) { byte[] data = blocks.remove(0); result = MPPUtility.getInt(data, 0); } else { result = 0; } return (result); }
[ "private", "int", "getInt", "(", "List", "<", "byte", "[", "]", ">", "blocks", ")", "{", "int", "result", ";", "if", "(", "blocks", ".", "isEmpty", "(", ")", "==", "false", ")", "{", "byte", "[", "]", "data", "=", "blocks", ".", "remove", "(", ...
Internal method used to retrieve a integer from an embedded data block. @param blocks list of data blocks @return int value
[ "Internal", "method", "used", "to", "retrieve", "a", "integer", "from", "an", "embedded", "data", "block", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L178-L191
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.getData
private byte[] getData(List<byte[]> blocks, int length) { byte[] result; if (blocks.isEmpty() == false) { if (length < 4) { length = 4; } result = new byte[length]; int offset = 0; byte[] data; while (offset < length) ...
java
private byte[] getData(List<byte[]> blocks, int length) { byte[] result; if (blocks.isEmpty() == false) { if (length < 4) { length = 4; } result = new byte[length]; int offset = 0; byte[] data; while (offset < length) ...
[ "private", "byte", "[", "]", "getData", "(", "List", "<", "byte", "[", "]", ">", "blocks", ",", "int", "length", ")", "{", "byte", "[", "]", "result", ";", "if", "(", "blocks", ".", "isEmpty", "(", ")", "==", "false", ")", "{", "if", "(", "leng...
Internal method used to retrieve a byte array from one or more embedded data blocks. Consecutive data blocks may need to be concatenated by this method in order to retrieve the complete set of data. @param blocks list of data blocks @param length expected length of the data @return byte array
[ "Internal", "method", "used", "to", "retrieve", "a", "byte", "array", "from", "one", "or", "more", "embedded", "data", "blocks", ".", "Consecutive", "data", "blocks", "may", "need", "to", "be", "concatenated", "by", "this", "method", "in", "order", "to", "...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L203-L231
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.readObjectData
private static int readObjectData(int offset, String text, List<RTFEmbeddedObject> objects) { LinkedList<byte[]> blocks = new LinkedList<byte[]>(); offset += (OBJDATA.length()); offset = skipEndOfLine(text, offset); int length; int lastOffset = offset; while (offset != -1) ...
java
private static int readObjectData(int offset, String text, List<RTFEmbeddedObject> objects) { LinkedList<byte[]> blocks = new LinkedList<byte[]>(); offset += (OBJDATA.length()); offset = skipEndOfLine(text, offset); int length; int lastOffset = offset; while (offset != -1) ...
[ "private", "static", "int", "readObjectData", "(", "int", "offset", ",", "String", "text", ",", "List", "<", "RTFEmbeddedObject", ">", "objects", ")", "{", "LinkedList", "<", "byte", "[", "]", ">", "blocks", "=", "new", "LinkedList", "<", "byte", "[", "]...
This method extracts byte arrays from the embedded object data and converts them into RTFEmbeddedObject instances, which it then adds to the supplied list. @param offset offset into the RTF document @param text RTF document @param objects destination for RTFEmbeddedObject instances @return new offset into the RTF docu...
[ "This", "method", "extracts", "byte", "arrays", "from", "the", "embedded", "object", "data", "and", "converts", "them", "into", "RTFEmbeddedObject", "instances", "which", "it", "then", "adds", "to", "the", "supplied", "list", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L243-L275
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.skipEndOfLine
private static int skipEndOfLine(String text, int offset) { char c; boolean finished = false; while (finished == false) { c = text.charAt(offset); switch (c) { case ' ': // found that OBJDATA could be followed by a space the EOL case '\r': ...
java
private static int skipEndOfLine(String text, int offset) { char c; boolean finished = false; while (finished == false) { c = text.charAt(offset); switch (c) { case ' ': // found that OBJDATA could be followed by a space the EOL case '\r': ...
[ "private", "static", "int", "skipEndOfLine", "(", "String", "text", ",", "int", "offset", ")", "{", "char", "c", ";", "boolean", "finished", "=", "false", ";", "while", "(", "finished", "==", "false", ")", "{", "c", "=", "text", ".", "charAt", "(", "...
This method skips the end-of-line markers in the RTF document. It also indicates if the end of the embedded object has been reached. @param text RTF document test @param offset offset into the RTF document @return new offset
[ "This", "method", "skips", "the", "end", "-", "of", "-", "line", "markers", "in", "the", "RTF", "document", ".", "It", "also", "indicates", "if", "the", "end", "of", "the", "embedded", "object", "has", "been", "reached", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L285-L319
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.getBlockLength
private static int getBlockLength(String text, int offset) { int startIndex = offset; boolean finished = false; char c; while (finished == false) { c = text.charAt(offset); switch (c) { case '\r': case '\n': case '}': ...
java
private static int getBlockLength(String text, int offset) { int startIndex = offset; boolean finished = false; char c; while (finished == false) { c = text.charAt(offset); switch (c) { case '\r': case '\n': case '}': ...
[ "private", "static", "int", "getBlockLength", "(", "String", "text", ",", "int", "offset", ")", "{", "int", "startIndex", "=", "offset", ";", "boolean", "finished", "=", "false", ";", "char", "c", ";", "while", "(", "finished", "==", "false", ")", "{", ...
Calculates the length of the next block of RTF data. @param text RTF data @param offset current offset into this data @return block length
[ "Calculates", "the", "length", "of", "the", "next", "block", "of", "RTF", "data", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L328-L358
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java
RTFEmbeddedObject.readDataBlock
private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks) { int bytes = length / 2; byte[] data = new byte[bytes]; for (int index = 0; index < bytes; index++) { data[index] = (byte) Integer.parseInt(text.substring(offset, offset + 2), 16); o...
java
private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks) { int bytes = length / 2; byte[] data = new byte[bytes]; for (int index = 0; index < bytes; index++) { data[index] = (byte) Integer.parseInt(text.substring(offset, offset + 2), 16); o...
[ "private", "static", "int", "readDataBlock", "(", "String", "text", ",", "int", "offset", ",", "int", "length", ",", "List", "<", "byte", "[", "]", ">", "blocks", ")", "{", "int", "bytes", "=", "length", "/", "2", ";", "byte", "[", "]", "data", "="...
Reads a data block and adds it to the list of blocks. @param text RTF data @param offset current offset @param length next block length @param blocks list of blocks @return next offset
[ "Reads", "a", "data", "block", "and", "adds", "it", "to", "the", "list", "of", "blocks", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L369-L382
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPP12Reader.java
MPP12Reader.readSubProject
private SubProject readSubProject(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex) { try { SubProject sp = new SubProject(); int type = SUBPROJECT_TASKUNIQUEID0; if (uniqueIDOffset != -1) { int value = MPPUtilit...
java
private SubProject readSubProject(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex) { try { SubProject sp = new SubProject(); int type = SUBPROJECT_TASKUNIQUEID0; if (uniqueIDOffset != -1) { int value = MPPUtilit...
[ "private", "SubProject", "readSubProject", "(", "byte", "[", "]", "data", ",", "int", "uniqueIDOffset", ",", "int", "filePathOffset", ",", "int", "fileNameOffset", ",", "int", "subprojectIndex", ")", "{", "try", "{", "SubProject", "sp", "=", "new", "SubProject...
Method used to read the sub project details from a byte array. @param data byte array @param uniqueIDOffset offset of unique ID @param filePathOffset offset of file path @param fileNameOffset offset of file name @param subprojectIndex index of the subproject, used to calculate unique id offset @return new SubProject i...
[ "Method", "used", "to", "read", "the", "sub", "project", "details", "from", "a", "byte", "array", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP12Reader.java#L569-L738
train
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/suretrak/TableReader.java
TableReader.readRecord
private void readRecord(byte[] buffer, Table table) { //System.out.println(ByteArrayHelper.hexdump(buffer, true, 16, "")); int deletedFlag = getShort(buffer, 0); if (deletedFlag != 0) { Map<String, Object> row = new HashMap<String, Object>(); for (ColumnDefinition column : m...
java
private void readRecord(byte[] buffer, Table table) { //System.out.println(ByteArrayHelper.hexdump(buffer, true, 16, "")); int deletedFlag = getShort(buffer, 0); if (deletedFlag != 0) { Map<String, Object> row = new HashMap<String, Object>(); for (ColumnDefinition column : m...
[ "private", "void", "readRecord", "(", "byte", "[", "]", "buffer", ",", "Table", "table", ")", "{", "//System.out.println(ByteArrayHelper.hexdump(buffer, true, 16, \"\"));", "int", "deletedFlag", "=", "getShort", "(", "buffer", ",", "0", ")", ";", "if", "(", "delet...
Reads a single record from the table. @param buffer record data @param table parent table
[ "Reads", "a", "single", "record", "from", "the", "table", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/suretrak/TableReader.java#L118-L134
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.decodeBuffer
public static final void decodeBuffer(byte[] data, byte encryptionCode) { for (int i = 0; i < data.length; i++) { data[i] = (byte) (data[i] ^ encryptionCode); } }
java
public static final void decodeBuffer(byte[] data, byte encryptionCode) { for (int i = 0; i < data.length; i++) { data[i] = (byte) (data[i] ^ encryptionCode); } }
[ "public", "static", "final", "void", "decodeBuffer", "(", "byte", "[", "]", "data", ",", "byte", "encryptionCode", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "data", ".", "length", ";", "i", "++", ")", "{", "data", "[", "i", "]", ...
This method decodes a byte array with the given encryption code using XOR encryption. @param data Source data @param encryptionCode Encryption code
[ "This", "method", "decodes", "a", "byte", "array", "with", "the", "given", "encryption", "code", "using", "XOR", "encryption", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L64-L70
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.decodePassword
public static final String decodePassword(byte[] data, byte encryptionCode) { String result; if (data.length < MINIMUM_PASSWORD_DATA_LENGTH) { result = null; } else { MPPUtility.decodeBuffer(data, encryptionCode); StringBuilder buffer = new StringBuild...
java
public static final String decodePassword(byte[] data, byte encryptionCode) { String result; if (data.length < MINIMUM_PASSWORD_DATA_LENGTH) { result = null; } else { MPPUtility.decodeBuffer(data, encryptionCode); StringBuilder buffer = new StringBuild...
[ "public", "static", "final", "String", "decodePassword", "(", "byte", "[", "]", "data", ",", "byte", "encryptionCode", ")", "{", "String", "result", ";", "if", "(", "data", ".", "length", "<", "MINIMUM_PASSWORD_DATA_LENGTH", ")", "{", "result", "=", "null", ...
Decode the password from the given data. Will decode the data block as well. @param data encrypted data block @param encryptionCode encryption code @return password
[ "Decode", "the", "password", "from", "the", "given", "data", ".", "Will", "decode", "the", "data", "block", "as", "well", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L112-L143
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getByteArray
public static final void getByteArray(byte[] data, int offset, int size, byte[] buffer, int bufferOffset) { System.arraycopy(data, offset, buffer, bufferOffset, size); }
java
public static final void getByteArray(byte[] data, int offset, int size, byte[] buffer, int bufferOffset) { System.arraycopy(data, offset, buffer, bufferOffset, size); }
[ "public", "static", "final", "void", "getByteArray", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "size", ",", "byte", "[", "]", "buffer", ",", "int", "bufferOffset", ")", "{", "System", ".", "arraycopy", "(", "data", ",", "offset",...
This method extracts a portion of a byte array and writes it into another byte array. @param data Source data @param offset Offset into source data @param size Required size to be extracted from the source data @param buffer Destination buffer @param bufferOffset Offset into destination buffer
[ "This", "method", "extracts", "a", "portion", "of", "a", "byte", "array", "and", "writes", "it", "into", "another", "byte", "array", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L155-L158
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getLong6
public static final long getLong6(byte[] data, int offset) { long result = 0; int i = offset; for (int shiftBy = 0; shiftBy < 48; shiftBy += 8) { result |= ((long) (data[i] & 0xff)) << shiftBy; ++i; } return result; }
java
public static final long getLong6(byte[] data, int offset) { long result = 0; int i = offset; for (int shiftBy = 0; shiftBy < 48; shiftBy += 8) { result |= ((long) (data[i] & 0xff)) << shiftBy; ++i; } return result; }
[ "public", "static", "final", "long", "getLong6", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "long", "result", "=", "0", ";", "int", "i", "=", "offset", ";", "for", "(", "int", "shiftBy", "=", "0", ";", "shiftBy", "<", "48", ";...
This method reads a six byte long from the input array. @param data the input array @param offset offset of integer data in the array @return integer value
[ "This", "method", "reads", "a", "six", "byte", "long", "from", "the", "input", "array", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L237-L247
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getTime
public static final Date getTime(byte[] data, int offset) { int time = getShort(data, offset) / 10; Calendar cal = DateHelper.popCalendar(EPOCH_DATE); cal.set(Calendar.HOUR_OF_DAY, (time / 60)); cal.set(Calendar.MINUTE, (time % 60)); cal.set(Calendar.SECOND, 0); cal.set(Calendar.M...
java
public static final Date getTime(byte[] data, int offset) { int time = getShort(data, offset) / 10; Calendar cal = DateHelper.popCalendar(EPOCH_DATE); cal.set(Calendar.HOUR_OF_DAY, (time / 60)); cal.set(Calendar.MINUTE, (time % 60)); cal.set(Calendar.SECOND, 0); cal.set(Calendar.M...
[ "public", "static", "final", "Date", "getTime", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "int", "time", "=", "getShort", "(", "data", ",", "offset", ")", "/", "10", ";", "Calendar", "cal", "=", "DateHelper", ".", "popCalendar", ...
Reads a time value. The time is represented as tenths of a minute since midnight. @param data byte array of data @param offset location of data as offset into the array @return time value
[ "Reads", "a", "time", "value", ".", "The", "time", "is", "represented", "as", "tenths", "of", "a", "minute", "since", "midnight", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L337-L347
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getTimestamp
public static final Date getTimestamp(byte[] data, int offset) { Date result; long days = getShort(data, offset + 2); if (days < 100) { // We are seeing some files which have very small values for the number of days. // When the relevant field is shown in MS Project it appe...
java
public static final Date getTimestamp(byte[] data, int offset) { Date result; long days = getShort(data, offset + 2); if (days < 100) { // We are seeing some files which have very small values for the number of days. // When the relevant field is shown in MS Project it appe...
[ "public", "static", "final", "Date", "getTimestamp", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "Date", "result", ";", "long", "days", "=", "getShort", "(", "data", ",", "offset", "+", "2", ")", ";", "if", "(", "days", "<", "100...
Reads a combined date and time value. @param data byte array of data @param offset location of data as offset into the array @return time value
[ "Reads", "a", "combined", "date", "and", "time", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L369-L397
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getTimestampFromTenths
public static final Date getTimestampFromTenths(byte[] data, int offset) { long ms = ((long) getInt(data, offset)) * 6000; return (DateHelper.getTimestampFromLong(EPOCH + ms)); }
java
public static final Date getTimestampFromTenths(byte[] data, int offset) { long ms = ((long) getInt(data, offset)) * 6000; return (DateHelper.getTimestampFromLong(EPOCH + ms)); }
[ "public", "static", "final", "Date", "getTimestampFromTenths", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "long", "ms", "=", "(", "(", "long", ")", "getInt", "(", "data", ",", "offset", ")", ")", "*", "6000", ";", "return", "(", ...
Reads a combined date and time value expressed in tenths of a minute. @param data byte array of data @param offset location of data as offset into the array @return time value
[ "Reads", "a", "combined", "date", "and", "time", "value", "expressed", "in", "tenths", "of", "a", "minute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L406-L410
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getUnicodeString
public static final String getUnicodeString(byte[] data, int offset) { int length = getUnicodeStringLengthInBytes(data, offset); return length == 0 ? "" : new String(data, offset, length, CharsetHelper.UTF16LE); }
java
public static final String getUnicodeString(byte[] data, int offset) { int length = getUnicodeStringLengthInBytes(data, offset); return length == 0 ? "" : new String(data, offset, length, CharsetHelper.UTF16LE); }
[ "public", "static", "final", "String", "getUnicodeString", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "int", "length", "=", "getUnicodeStringLengthInBytes", "(", "data", ",", "offset", ")", ";", "return", "length", "==", "0", "?", "\"\"...
Reads a string of two byte characters from the input array. This method assumes that the string finishes either at the end of the array, or when char zero is encountered. The value starts at the position specified by the offset parameter. @param data byte array of data @param offset start point of unicode string @retu...
[ "Reads", "a", "string", "of", "two", "byte", "characters", "from", "the", "input", "array", ".", "This", "method", "assumes", "that", "the", "string", "finishes", "either", "at", "the", "end", "of", "the", "array", "or", "when", "char", "zero", "is", "en...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L423-L427
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getUnicodeStringLengthInBytes
private static final int getUnicodeStringLengthInBytes(byte[] data, int offset) { int result; if (data == null || offset >= data.length) { result = 0; } else { result = data.length - offset; for (int loop = offset; loop < (data.length - 1); loop += 2) ...
java
private static final int getUnicodeStringLengthInBytes(byte[] data, int offset) { int result; if (data == null || offset >= data.length) { result = 0; } else { result = data.length - offset; for (int loop = offset; loop < (data.length - 1); loop += 2) ...
[ "private", "static", "final", "int", "getUnicodeStringLengthInBytes", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "int", "result", ";", "if", "(", "data", "==", "null", "||", "offset", ">=", "data", ".", "length", ")", "{", "result", ...
Determine the length of a nul terminated UTF16LE string in bytes. @param data string data @param offset offset into string data @return length in bytes
[ "Determine", "the", "length", "of", "a", "nul", "terminated", "UTF16LE", "string", "in", "bytes", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L459-L480
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getString
public static final String getString(byte[] data, int offset) { StringBuilder buffer = new StringBuilder(); char c; for (int loop = 0; offset + loop < data.length; loop++) { c = (char) data[offset + loop]; if (c == 0) { break; } buff...
java
public static final String getString(byte[] data, int offset) { StringBuilder buffer = new StringBuilder(); char c; for (int loop = 0; offset + loop < data.length; loop++) { c = (char) data[offset + loop]; if (c == 0) { break; } buff...
[ "public", "static", "final", "String", "getString", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "char", "c", ";", "for", "(", "int", "loop", "=", "0", ";", "off...
Reads a string of single byte characters from the input array. This method assumes that the string finishes either at the end of the array, or when char zero is encountered. Reading begins at the supplied offset into the array. @param data byte array of data @param offset offset into the array @return string value
[ "Reads", "a", "string", "of", "single", "byte", "characters", "from", "the", "input", "array", ".", "This", "method", "assumes", "that", "the", "string", "finishes", "either", "at", "the", "end", "of", "the", "array", "or", "when", "char", "zero", "is", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L492-L510
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getColor
public static final Color getColor(byte[] data, int offset) { Color result = null; if (getByte(data, offset + 3) == 0) { int r = getByte(data, offset); int g = getByte(data, offset + 1); int b = getByte(data, offset + 2); result = new Color(r, g, b); } ...
java
public static final Color getColor(byte[] data, int offset) { Color result = null; if (getByte(data, offset + 3) == 0) { int r = getByte(data, offset); int g = getByte(data, offset + 1); int b = getByte(data, offset + 2); result = new Color(r, g, b); } ...
[ "public", "static", "final", "Color", "getColor", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "Color", "result", "=", "null", ";", "if", "(", "getByte", "(", "data", ",", "offset", "+", "3", ")", "==", "0", ")", "{", "int", "r"...
Reads a color value represented by three bytes, for R, G, and B components, plus a flag byte indicating if this is an automatic color. Returns null if the color type is "Automatic". @param data byte array of data @param offset offset into array @return new Color instance
[ "Reads", "a", "color", "value", "represented", "by", "three", "bytes", "for", "R", "G", "and", "B", "components", "plus", "a", "flag", "byte", "indicating", "if", "this", "is", "an", "automatic", "color", ".", "Returns", "null", "if", "the", "color", "ty...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L534-L547
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.removeAmpersands
public static final String removeAmpersands(String name) { if (name != null) { if (name.indexOf('&') != -1) { StringBuilder sb = new StringBuilder(); int index = 0; char c; while (index < name.length()) { c = na...
java
public static final String removeAmpersands(String name) { if (name != null) { if (name.indexOf('&') != -1) { StringBuilder sb = new StringBuilder(); int index = 0; char c; while (index < name.length()) { c = na...
[ "public", "static", "final", "String", "removeAmpersands", "(", "String", "name", ")", "{", "if", "(", "name", "!=", "null", ")", "{", "if", "(", "name", ".", "indexOf", "(", "'", "'", ")", "!=", "-", "1", ")", "{", "StringBuilder", "sb", "=", "new...
Utility method to remove ampersands embedded in names. @param name name text @return name text without embedded ampersands
[ "Utility", "method", "to", "remove", "ampersands", "embedded", "in", "names", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L889-L914
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.getPercentage
public static final Double getPercentage(byte[] data, int offset) { int value = MPPUtility.getShort(data, offset); Double result = null; if (value >= 0 && value <= 100) { result = NumberHelper.getDouble(value); } return result; }
java
public static final Double getPercentage(byte[] data, int offset) { int value = MPPUtility.getShort(data, offset); Double result = null; if (value >= 0 && value <= 100) { result = NumberHelper.getDouble(value); } return result; }
[ "public", "static", "final", "Double", "getPercentage", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "int", "value", "=", "MPPUtility", ".", "getShort", "(", "data", ",", "offset", ")", ";", "Double", "result", "=", "null", ";", "if",...
Utility method to read a percentage value. @param data data block @param offset offset into data block @return percentage value
[ "Utility", "method", "to", "read", "a", "percentage", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L923-L932
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.cloneSubArray
public static final byte[] cloneSubArray(byte[] data, int offset, int size) { byte[] newData = new byte[size]; System.arraycopy(data, offset, newData, 0, size); return (newData); }
java
public static final byte[] cloneSubArray(byte[] data, int offset, int size) { byte[] newData = new byte[size]; System.arraycopy(data, offset, newData, 0, size); return (newData); }
[ "public", "static", "final", "byte", "[", "]", "cloneSubArray", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "size", ")", "{", "byte", "[", "]", "newData", "=", "new", "byte", "[", "size", "]", ";", "System", ".", "arraycopy", "...
This method allows a subsection of a byte array to be copied. @param data source data @param offset offset into the source data @param size length of the source data to copy @return new byte array containing copied data
[ "This", "method", "allows", "a", "subsection", "of", "a", "byte", "array", "to", "be", "copied", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L942-L947
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/MPPUtility.java
MPPUtility.dumpBlockData
public static void dumpBlockData(int headerSize, int blockSize, byte[] data) { if (data != null) { System.out.println(ByteArrayHelper.hexdump(data, 0, headerSize, false)); int index = headerSize; while (index < data.length) { System.out.println(ByteArrayHel...
java
public static void dumpBlockData(int headerSize, int blockSize, byte[] data) { if (data != null) { System.out.println(ByteArrayHelper.hexdump(data, 0, headerSize, false)); int index = headerSize; while (index < data.length) { System.out.println(ByteArrayHel...
[ "public", "static", "void", "dumpBlockData", "(", "int", "headerSize", ",", "int", "blockSize", ",", "byte", "[", "]", "data", ")", "{", "if", "(", "data", "!=", "null", ")", "{", "System", ".", "out", ".", "println", "(", "ByteArrayHelper", ".", "hexd...
Dumps the contents of a structured block made up from a header and fixed sized records. @param headerSize header zie @param blockSize block size @param data data block
[ "Dumps", "the", "contents", "of", "a", "structured", "block", "made", "up", "from", "a", "header", "and", "fixed", "sized", "records", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L1256-L1268
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getDuration
@Deprecated public Duration getDuration(Date startDate, Date endDate) throws MPXJException { return (getDuration("Standard", startDate, endDate)); }
java
@Deprecated public Duration getDuration(Date startDate, Date endDate) throws MPXJException { return (getDuration("Standard", startDate, endDate)); }
[ "@", "Deprecated", "public", "Duration", "getDuration", "(", "Date", "startDate", ",", "Date", "endDate", ")", "throws", "MPXJException", "{", "return", "(", "getDuration", "(", "\"Standard\"", ",", "startDate", ",", "endDate", ")", ")", ";", "}" ]
This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar. The calendar used is the "Standard" calendar. If this calendar does not exist, and exception will be thrown. @param startDate start of the period @param endDate end of the period ...
[ "This", "method", "is", "used", "to", "calculate", "the", "duration", "of", "work", "between", "two", "fixed", "dates", "according", "to", "the", "work", "schedule", "defined", "in", "the", "named", "calendar", ".", "The", "calendar", "used", "is", "the", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L336-L339
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getDuration
@Deprecated public Duration getDuration(String calendarName, Date startDate, Date endDate) throws MPXJException { ProjectCalendar calendar = getCalendarByName(calendarName); if (calendar == null) { throw new MPXJException(MPXJException.CALENDAR_ERROR + ": " + calendarName); } ...
java
@Deprecated public Duration getDuration(String calendarName, Date startDate, Date endDate) throws MPXJException { ProjectCalendar calendar = getCalendarByName(calendarName); if (calendar == null) { throw new MPXJException(MPXJException.CALENDAR_ERROR + ": " + calendarName); } ...
[ "@", "Deprecated", "public", "Duration", "getDuration", "(", "String", "calendarName", ",", "Date", "startDate", ",", "Date", "endDate", ")", "throws", "MPXJException", "{", "ProjectCalendar", "calendar", "=", "getCalendarByName", "(", "calendarName", ")", ";", "i...
This method is used to calculate the duration of work between two fixed dates according to the work schedule defined in the named calendar. The name of the calendar to be used is passed as an argument. @param calendarName name of the calendar to use @param startDate start of the period @param endDate end of the period...
[ "This", "method", "is", "used", "to", "calculate", "the", "duration", "of", "work", "between", "two", "fixed", "dates", "according", "to", "the", "work", "schedule", "defined", "in", "the", "named", "calendar", ".", "The", "name", "of", "the", "calendar", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L353-L363
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getStartDate
public Date getStartDate() { Date startDate = null; for (Task task : m_tasks) { // // If a hidden "summary" task is present we ignore it // if (NumberHelper.getInt(task.getUniqueID()) == 0) { continue; } // // Sel...
java
public Date getStartDate() { Date startDate = null; for (Task task : m_tasks) { // // If a hidden "summary" task is present we ignore it // if (NumberHelper.getInt(task.getUniqueID()) == 0) { continue; } // // Sel...
[ "public", "Date", "getStartDate", "(", ")", "{", "Date", "startDate", "=", "null", ";", "for", "(", "Task", "task", ":", "m_tasks", ")", "{", "//", "// If a hidden \"summary\" task is present we ignore it", "//", "if", "(", "NumberHelper", ".", "getInt", "(", ...
Find the earliest task start date. We treat this as the start date for the project. @return start date
[ "Find", "the", "earliest", "task", "start", "date", ".", "We", "treat", "this", "as", "the", "start", "date", "for", "the", "project", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L430-L485
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getFinishDate
public Date getFinishDate() { Date finishDate = null; for (Task task : m_tasks) { // // If a hidden "summary" task is present we ignore it // if (NumberHelper.getInt(task.getUniqueID()) == 0) { continue; } // // S...
java
public Date getFinishDate() { Date finishDate = null; for (Task task : m_tasks) { // // If a hidden "summary" task is present we ignore it // if (NumberHelper.getInt(task.getUniqueID()) == 0) { continue; } // // S...
[ "public", "Date", "getFinishDate", "(", ")", "{", "Date", "finishDate", "=", "null", ";", "for", "(", "Task", "task", ":", "m_tasks", ")", "{", "//", "// If a hidden \"summary\" task is present we ignore it", "//", "if", "(", "NumberHelper", ".", "getInt", "(", ...
Find the latest task finish date. We treat this as the finish date for the project. @return finish date
[ "Find", "the", "latest", "task", "finish", "date", ".", "We", "treat", "this", "as", "the", "finish", "date", "for", "the", "project", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L493-L534
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getDefaultCalendar
public ProjectCalendar getDefaultCalendar() { String calendarName = m_properties.getDefaultCalendarName(); ProjectCalendar calendar = getCalendarByName(calendarName); if (calendar == null) { if (m_calendars.isEmpty()) { calendar = addDefaultBaseCalendar(); ...
java
public ProjectCalendar getDefaultCalendar() { String calendarName = m_properties.getDefaultCalendarName(); ProjectCalendar calendar = getCalendarByName(calendarName); if (calendar == null) { if (m_calendars.isEmpty()) { calendar = addDefaultBaseCalendar(); ...
[ "public", "ProjectCalendar", "getDefaultCalendar", "(", ")", "{", "String", "calendarName", "=", "m_properties", ".", "getDefaultCalendarName", "(", ")", ";", "ProjectCalendar", "calendar", "=", "getCalendarByName", "(", "calendarName", ")", ";", "if", "(", "calenda...
Retrieves the default calendar for this project based on the calendar name given in the project properties. If a calendar of this name cannot be found, then the first calendar listed for the project will be returned. If the project contains no calendars, then a default calendar is added. @return default projectCalenda...
[ "Retrieves", "the", "default", "calendar", "for", "this", "project", "based", "on", "the", "calendar", "name", "given", "in", "the", "project", "properties", ".", "If", "a", "calendar", "of", "this", "name", "cannot", "be", "found", "then", "the", "first", ...
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L624-L640
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectFile.java
ProjectFile.getBaselineCalendar
public ProjectCalendar getBaselineCalendar() { // // Attempt to locate the calendar normally used by baselines // If this isn't present, fall back to using the default // project calendar. // ProjectCalendar result = getCalendarByName("Used for Microsoft Project 98 Baseline Calend...
java
public ProjectCalendar getBaselineCalendar() { // // Attempt to locate the calendar normally used by baselines // If this isn't present, fall back to using the default // project calendar. // ProjectCalendar result = getCalendarByName("Used for Microsoft Project 98 Baseline Calend...
[ "public", "ProjectCalendar", "getBaselineCalendar", "(", ")", "{", "//", "// Attempt to locate the calendar normally used by baselines", "// If this isn't present, fall back to using the default", "// project calendar.", "//", "ProjectCalendar", "result", "=", "getCalendarByName", "(",...
Retrieve the calendar used internally for timephased baseline calculation. @return baseline calendar
[ "Retrieve", "the", "calendar", "used", "internally", "for", "timephased", "baseline", "calculation", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectFile.java#L657-L670
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java
GraphicalIndicatorReader.process
public void process(CustomFieldContainer indicators, ProjectProperties properties, Props props) { m_container = indicators; m_properties = properties; m_data = props.getByteArray(Props.TASK_FIELD_ATTRIBUTES); if (m_data != null) { int columnsCount = MPPUtility.getInt(m_data, 4...
java
public void process(CustomFieldContainer indicators, ProjectProperties properties, Props props) { m_container = indicators; m_properties = properties; m_data = props.getByteArray(Props.TASK_FIELD_ATTRIBUTES); if (m_data != null) { int columnsCount = MPPUtility.getInt(m_data, 4...
[ "public", "void", "process", "(", "CustomFieldContainer", "indicators", ",", "ProjectProperties", "properties", ",", "Props", "props", ")", "{", "m_container", "=", "indicators", ";", "m_properties", "=", "properties", ";", "m_data", "=", "props", ".", "getByteArr...
The main entry point for processing graphical indicator definitions. @param indicators graphical indicators container @param properties project properties @param props properties data
[ "The", "main", "entry", "point", "for", "processing", "graphical", "indicator", "definitions", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java#L50-L65
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java
GraphicalIndicatorReader.processColumns
private void processColumns() { int fieldID = MPPUtility.getInt(m_data, m_headerOffset); m_headerOffset += 4; m_dataOffset = MPPUtility.getInt(m_data, m_headerOffset); m_headerOffset += 4; FieldType type = FieldTypeHelper.getInstance(fieldID); if (type.getDataType() != null) ...
java
private void processColumns() { int fieldID = MPPUtility.getInt(m_data, m_headerOffset); m_headerOffset += 4; m_dataOffset = MPPUtility.getInt(m_data, m_headerOffset); m_headerOffset += 4; FieldType type = FieldTypeHelper.getInstance(fieldID); if (type.getDataType() != null) ...
[ "private", "void", "processColumns", "(", ")", "{", "int", "fieldID", "=", "MPPUtility", ".", "getInt", "(", "m_data", ",", "m_headerOffset", ")", ";", "m_headerOffset", "+=", "4", ";", "m_dataOffset", "=", "MPPUtility", ".", "getInt", "(", "m_data", ",", ...
Processes graphical indicator definitions for each column.
[ "Processes", "graphical", "indicator", "definitions", "for", "each", "column", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java#L70-L83
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java
GraphicalIndicatorReader.processKnownType
private void processKnownType(FieldType type) { //System.out.println("Header: " + type); //System.out.println(ByteArrayHelper.hexdump(m_data, m_dataOffset, 36, false, 16, "")); GraphicalIndicator indicator = m_container.getCustomField(type).getGraphicalIndicator(); indicator.setFieldType(typ...
java
private void processKnownType(FieldType type) { //System.out.println("Header: " + type); //System.out.println(ByteArrayHelper.hexdump(m_data, m_dataOffset, 36, false, 16, "")); GraphicalIndicator indicator = m_container.getCustomField(type).getGraphicalIndicator(); indicator.setFieldType(typ...
[ "private", "void", "processKnownType", "(", "FieldType", "type", ")", "{", "//System.out.println(\"Header: \" + type);", "//System.out.println(ByteArrayHelper.hexdump(m_data, m_dataOffset, 36, false, 16, \"\"));", "GraphicalIndicator", "indicator", "=", "m_container", ".", "getCustomFi...
Process a graphical indicator definition for a known type. @param type field type
[ "Process", "a", "graphical", "indicator", "definition", "for", "a", "known", "type", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java#L90-L139
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java
GraphicalIndicatorReader.processCriteria
private GraphicalIndicatorCriteria processCriteria(FieldType type) { GraphicalIndicatorCriteria criteria = new GraphicalIndicatorCriteria(m_properties); criteria.setLeftValue(type); int indicatorType = MPPUtility.getInt(m_data, m_dataOffset); m_dataOffset += 4; criteria.setIndicator(in...
java
private GraphicalIndicatorCriteria processCriteria(FieldType type) { GraphicalIndicatorCriteria criteria = new GraphicalIndicatorCriteria(m_properties); criteria.setLeftValue(type); int indicatorType = MPPUtility.getInt(m_data, m_dataOffset); m_dataOffset += 4; criteria.setIndicator(in...
[ "private", "GraphicalIndicatorCriteria", "processCriteria", "(", "FieldType", "type", ")", "{", "GraphicalIndicatorCriteria", "criteria", "=", "new", "GraphicalIndicatorCriteria", "(", "m_properties", ")", ";", "criteria", ".", "setLeftValue", "(", "type", ")", ";", "...
Process the graphical indicator criteria for a single column. @param type field type @return indicator criteria data
[ "Process", "the", "graphical", "indicator", "criteria", "for", "a", "single", "column", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java#L147-L175
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java
GraphicalIndicatorReader.processOperandValue
private void processOperandValue(int index, FieldType type, GraphicalIndicatorCriteria criteria) { boolean valueFlag = (MPPUtility.getInt(m_data, m_dataOffset) == 1); m_dataOffset += 4; if (valueFlag == false) { int fieldID = MPPUtility.getInt(m_data, m_dataOffset); criteri...
java
private void processOperandValue(int index, FieldType type, GraphicalIndicatorCriteria criteria) { boolean valueFlag = (MPPUtility.getInt(m_data, m_dataOffset) == 1); m_dataOffset += 4; if (valueFlag == false) { int fieldID = MPPUtility.getInt(m_data, m_dataOffset); criteri...
[ "private", "void", "processOperandValue", "(", "int", "index", ",", "FieldType", "type", ",", "GraphicalIndicatorCriteria", "criteria", ")", "{", "boolean", "valueFlag", "=", "(", "MPPUtility", ".", "getInt", "(", "m_data", ",", "m_dataOffset", ")", "==", "1", ...
Process an operand value used in the definition of the graphical indicator criteria. @param index position in operand list @param type field type @param criteria indicator criteria
[ "Process", "an", "operand", "value", "used", "in", "the", "definition", "of", "the", "graphical", "indicator", "criteria", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GraphicalIndicatorReader.java#L185-L257
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/GanttChartView12.java
GanttChartView12.getGridLines
private GridLines getGridLines(byte[] data, int offset) { Color normalLineColor = ColorType.getInstance(data[offset]).getColor(); LineStyle normalLineStyle = LineStyle.getInstance(data[offset + 3]); int intervalNumber = data[offset + 4]; LineStyle intervalLineStyle = LineStyle.getInstance(dat...
java
private GridLines getGridLines(byte[] data, int offset) { Color normalLineColor = ColorType.getInstance(data[offset]).getColor(); LineStyle normalLineStyle = LineStyle.getInstance(data[offset + 3]); int intervalNumber = data[offset + 4]; LineStyle intervalLineStyle = LineStyle.getInstance(dat...
[ "private", "GridLines", "getGridLines", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "Color", "normalLineColor", "=", "ColorType", ".", "getInstance", "(", "data", "[", "offset", "]", ")", ".", "getColor", "(", ")", ";", "LineStyle", "n...
Creates a new GridLines instance. @param data data block @param offset offset into data block @return new GridLines instance
[ "Creates", "a", "new", "GridLines", "instance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GanttChartView12.java#L229-L237
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getByteArray
public byte[] getByteArray(Integer offset) { byte[] result = null; if (offset != null) { result = m_map.get(offset); } return (result); }
java
public byte[] getByteArray(Integer offset) { byte[] result = null; if (offset != null) { result = m_map.get(offset); } return (result); }
[ "public", "byte", "[", "]", "getByteArray", "(", "Integer", "offset", ")", "{", "byte", "[", "]", "result", "=", "null", ";", "if", "(", "offset", "!=", "null", ")", "{", "result", "=", "m_map", ".", "get", "(", "offset", ")", ";", "}", "return", ...
This method retrieves a byte array containing the data at the given offset in the block. If no data is found at the given offset this method returns null. @param offset offset of required data @return byte array containing required data
[ "This", "method", "retrieves", "a", "byte", "array", "containing", "the", "data", "at", "the", "given", "offset", "in", "the", "block", ".", "If", "no", "data", "is", "found", "at", "the", "given", "offset", "this", "method", "returns", "null", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L119-L129
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getByteArray
public byte[] getByteArray(Integer id, Integer type) { return (getByteArray(m_meta.getOffset(id, type))); }
java
public byte[] getByteArray(Integer id, Integer type) { return (getByteArray(m_meta.getOffset(id, type))); }
[ "public", "byte", "[", "]", "getByteArray", "(", "Integer", "id", ",", "Integer", "type", ")", "{", "return", "(", "getByteArray", "(", "m_meta", ".", "getOffset", "(", "id", ",", "type", ")", ")", ")", ";", "}" ]
This method retrieves a byte array of the specified type, belonging to the item with the specified unique ID. @param id unique ID of entity to which this data belongs @param type data type identifier @return byte array containing required data
[ "This", "method", "retrieves", "a", "byte", "array", "of", "the", "specified", "type", "belonging", "to", "the", "item", "with", "the", "specified", "unique", "ID", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L139-L142
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getUnicodeString
public String getUnicodeString(Integer id, Integer type) { return (getUnicodeString(m_meta.getOffset(id, type))); }
java
public String getUnicodeString(Integer id, Integer type) { return (getUnicodeString(m_meta.getOffset(id, type))); }
[ "public", "String", "getUnicodeString", "(", "Integer", "id", ",", "Integer", "type", ")", "{", "return", "(", "getUnicodeString", "(", "m_meta", ".", "getOffset", "(", "id", ",", "type", ")", ")", ")", ";", "}" ]
This method retrieves a String of the specified type, belonging to the item with the specified unique ID. @param id unique ID of entity to which this data belongs @param type data type identifier @return string containing required data
[ "This", "method", "retrieves", "a", "String", "of", "the", "specified", "type", "belonging", "to", "the", "item", "with", "the", "specified", "unique", "ID", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L176-L179
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getString
public String getString(Integer offset) { String result = null; if (offset != null) { byte[] value = m_map.get(offset); if (value != null) { result = MPPUtility.getString(value, 0); } } return (result); }
java
public String getString(Integer offset) { String result = null; if (offset != null) { byte[] value = m_map.get(offset); if (value != null) { result = MPPUtility.getString(value, 0); } } return (result); }
[ "public", "String", "getString", "(", "Integer", "offset", ")", "{", "String", "result", "=", "null", ";", "if", "(", "offset", "!=", "null", ")", "{", "byte", "[", "]", "value", "=", "m_map", ".", "get", "(", "offset", ")", ";", "if", "(", "value"...
This method retrieves the data at the given offset and returns it as a String, assuming the underlying data is composed of single byte characters. @param offset offset of required data @return string containing required data
[ "This", "method", "retrieves", "the", "data", "at", "the", "given", "offset", "and", "returns", "it", "as", "a", "String", "assuming", "the", "underlying", "data", "is", "composed", "of", "single", "byte", "characters", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L215-L229
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getString
public String getString(Integer id, Integer type) { return (getString(m_meta.getOffset(id, type))); }
java
public String getString(Integer id, Integer type) { return (getString(m_meta.getOffset(id, type))); }
[ "public", "String", "getString", "(", "Integer", "id", ",", "Integer", "type", ")", "{", "return", "(", "getString", "(", "m_meta", ".", "getOffset", "(", "id", ",", "type", ")", ")", ")", ";", "}" ]
This method retrieves a string of the specified type, belonging to the item with the specified unique ID. @param id unique ID of entity to which this data belongs @param type data type identifier @return required string data
[ "This", "method", "retrieves", "a", "string", "of", "the", "specified", "type", "belonging", "to", "the", "item", "with", "the", "specified", "unique", "ID", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L239-L242
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getShort
public int getShort(Integer id, Integer type) { int result = 0; Integer offset = m_meta.getOffset(id, type); if (offset != null) { byte[] value = m_map.get(offset); if (value != null && value.length >= 2) { result = MPPUtility.getShort(value, 0); ...
java
public int getShort(Integer id, Integer type) { int result = 0; Integer offset = m_meta.getOffset(id, type); if (offset != null) { byte[] value = m_map.get(offset); if (value != null && value.length >= 2) { result = MPPUtility.getShort(value, 0); ...
[ "public", "int", "getShort", "(", "Integer", "id", ",", "Integer", "type", ")", "{", "int", "result", "=", "0", ";", "Integer", "offset", "=", "m_meta", ".", "getOffset", "(", "id", ",", "type", ")", ";", "if", "(", "offset", "!=", "null", ")", "{"...
This method retrieves an integer of the specified type, belonging to the item with the specified unique ID. @param id unique ID of entity to which this data belongs @param type data type identifier @return required integer data
[ "This", "method", "retrieves", "an", "integer", "of", "the", "specified", "type", "belonging", "to", "the", "item", "with", "the", "specified", "unique", "ID", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L252-L269
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Var2Data.java
Var2Data.getDouble
public double getDouble(Integer id, Integer type) { double result = Double.longBitsToDouble(getLong(id, type)); if (Double.isNaN(result)) { result = 0; } return result; }
java
public double getDouble(Integer id, Integer type) { double result = Double.longBitsToDouble(getLong(id, type)); if (Double.isNaN(result)) { result = 0; } return result; }
[ "public", "double", "getDouble", "(", "Integer", "id", ",", "Integer", "type", ")", "{", "double", "result", "=", "Double", ".", "longBitsToDouble", "(", "getLong", "(", "id", ",", "type", ")", ")", ";", "if", "(", "Double", ".", "isNaN", "(", "result"...
This method retrieves a double of the specified type, belonging to the item with the specified unique ID. @param id unique ID of entity to which this data belongs @param type data type identifier @return required double data
[ "This", "method", "retrieves", "a", "double", "of", "the", "specified", "type", "belonging", "to", "the", "item", "with", "the", "specified", "unique", "ID", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L390-L398
train
joniles/mpxj
src/main/java/net/sf/mpxj/ProjectCalendarDateRanges.java
ProjectCalendarDateRanges.getRange
public DateRange getRange(int index) { DateRange result; if (index >= 0 && index < m_ranges.size()) { result = m_ranges.get(index); } else { result = DateRange.EMPTY_RANGE; } return (result); }
java
public DateRange getRange(int index) { DateRange result; if (index >= 0 && index < m_ranges.size()) { result = m_ranges.get(index); } else { result = DateRange.EMPTY_RANGE; } return (result); }
[ "public", "DateRange", "getRange", "(", "int", "index", ")", "{", "DateRange", "result", ";", "if", "(", "index", ">=", "0", "&&", "index", "<", "m_ranges", ".", "size", "(", ")", ")", "{", "result", "=", "m_ranges", ".", "get", "(", "index", ")", ...
Retrieve the date range at the specified index. The index is zero based, and this method will return null if the requested date range does not exist. @param index range index @return date range instance
[ "Retrieve", "the", "date", "range", "at", "the", "specified", "index", ".", "The", "index", "is", "zero", "based", "and", "this", "method", "will", "return", "null", "if", "the", "requested", "date", "range", "does", "not", "exist", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarDateRanges.java#L53-L67
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.process
public GenericCriteria process(ProjectProperties properties, byte[] data, int dataOffset, int entryOffset, List<GenericCriteriaPrompt> prompts, List<FieldType> fields, boolean[] criteriaType) { m_properties = properties; m_prompts = prompts; m_fields = fields; m_criteriaType = criteriaType; ...
java
public GenericCriteria process(ProjectProperties properties, byte[] data, int dataOffset, int entryOffset, List<GenericCriteriaPrompt> prompts, List<FieldType> fields, boolean[] criteriaType) { m_properties = properties; m_prompts = prompts; m_fields = fields; m_criteriaType = criteriaType; ...
[ "public", "GenericCriteria", "process", "(", "ProjectProperties", "properties", ",", "byte", "[", "]", "data", ",", "int", "dataOffset", ",", "int", "entryOffset", ",", "List", "<", "GenericCriteriaPrompt", ">", "prompts", ",", "List", "<", "FieldType", ">", "...
Main entry point to read criteria data. @param properties project properties @param data criteria data block @param dataOffset offset of the data start within the larger data block @param entryOffset offset of start node for walking the tree @param prompts optional list to hold prompts @param fields optional list of h...
[ "Main", "entry", "point", "to", "read", "criteria", "data", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L131-L189
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.processBlock
private void processBlock(List<GenericCriteria> list, byte[] block) { if (block != null) { if (MPPUtility.getShort(block, 0) > 0x3E6) { addCriteria(list, block); } else { switch (block[0]) { case (byte) 0x0B: ...
java
private void processBlock(List<GenericCriteria> list, byte[] block) { if (block != null) { if (MPPUtility.getShort(block, 0) > 0x3E6) { addCriteria(list, block); } else { switch (block[0]) { case (byte) 0x0B: ...
[ "private", "void", "processBlock", "(", "List", "<", "GenericCriteria", ">", "list", ",", "byte", "[", "]", "block", ")", "{", "if", "(", "block", "!=", "null", ")", "{", "if", "(", "MPPUtility", ".", "getShort", "(", "block", ",", "0", ")", ">", "...
Process a single criteria block. @param list parent criteria list @param block current block
[ "Process", "a", "single", "criteria", "block", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L197-L243
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.addCriteria
private void addCriteria(List<GenericCriteria> list, byte[] block) { byte[] leftBlock = getChildBlock(block); byte[] rightBlock1 = getListNextBlock(leftBlock); byte[] rightBlock2 = getListNextBlock(rightBlock1); TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - ...
java
private void addCriteria(List<GenericCriteria> list, byte[] block) { byte[] leftBlock = getChildBlock(block); byte[] rightBlock1 = getListNextBlock(leftBlock); byte[] rightBlock2 = getListNextBlock(rightBlock1); TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - ...
[ "private", "void", "addCriteria", "(", "List", "<", "GenericCriteria", ">", "list", ",", "byte", "[", "]", "block", ")", "{", "byte", "[", "]", "leftBlock", "=", "getChildBlock", "(", "block", ")", ";", "byte", "[", "]", "rightBlock1", "=", "getListNextB...
Adds a basic LHS OPERATOR RHS block. @param list parent criteria list @param block current block
[ "Adds", "a", "basic", "LHS", "OPERATOR", "RHS", "block", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L251-L280
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.addBlock
private void addBlock(List<GenericCriteria> list, byte[] block, TestOperator operator) { GenericCriteria result = new GenericCriteria(m_properties); result.setOperator(operator); list.add(result); processBlock(result.getCriteriaList(), getChildBlock(block)); processBlock(list, getListNe...
java
private void addBlock(List<GenericCriteria> list, byte[] block, TestOperator operator) { GenericCriteria result = new GenericCriteria(m_properties); result.setOperator(operator); list.add(result); processBlock(result.getCriteriaList(), getChildBlock(block)); processBlock(list, getListNe...
[ "private", "void", "addBlock", "(", "List", "<", "GenericCriteria", ">", "list", ",", "byte", "[", "]", "block", ",", "TestOperator", "operator", ")", "{", "GenericCriteria", "result", "=", "new", "GenericCriteria", "(", "m_properties", ")", ";", "result", "...
Adds a logical operator block. @param list parent criteria list @param block current block @param operator logical operator represented by this block
[ "Adds", "a", "logical", "operator", "block", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L289-L296
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.getValue
private Object getValue(FieldType field, byte[] block) { Object result = null; switch (block[0]) { case 0x07: // Field { result = getFieldType(block); break; } case 0x01: // Constant value { result = getConstantValue...
java
private Object getValue(FieldType field, byte[] block) { Object result = null; switch (block[0]) { case 0x07: // Field { result = getFieldType(block); break; } case 0x01: // Constant value { result = getConstantValue...
[ "private", "Object", "getValue", "(", "FieldType", "field", ",", "byte", "[", "]", "block", ")", "{", "Object", "result", "=", "null", ";", "switch", "(", "block", "[", "0", "]", ")", "{", "case", "0x07", ":", "// Field", "{", "result", "=", "getFiel...
Retrieves the value component of a criteria expression. @param field field type @param block block data @return field value
[ "Retrieves", "the", "value", "component", "of", "a", "criteria", "expression", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L305-L331
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.getConstantValue
private Object getConstantValue(FieldType type, byte[] block) { Object value; DataType dataType = type.getDataType(); if (dataType == null) { value = null; } else { switch (dataType) { case DURATION: { value ...
java
private Object getConstantValue(FieldType type, byte[] block) { Object value; DataType dataType = type.getDataType(); if (dataType == null) { value = null; } else { switch (dataType) { case DURATION: { value ...
[ "private", "Object", "getConstantValue", "(", "FieldType", "type", ",", "byte", "[", "]", "block", ")", "{", "Object", "value", ";", "DataType", "dataType", "=", "type", ".", "getDataType", "(", ")", ";", "if", "(", "dataType", "==", "null", ")", "{", ...
Retrieves a constant value. @param type field type @param block criteria data block @return constant value
[ "Retrieves", "a", "constant", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L340-L406
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/CriteriaReader.java
CriteriaReader.getPromptValue
private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block) { int textOffset = getPromptOffset(block); String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset); GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(), value); ...
java
private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block) { int textOffset = getPromptOffset(block); String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset); GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(), value); ...
[ "private", "GenericCriteriaPrompt", "getPromptValue", "(", "FieldType", "field", ",", "byte", "[", "]", "block", ")", "{", "int", "textOffset", "=", "getPromptOffset", "(", "block", ")", ";", "String", "value", "=", "MPPUtility", ".", "getUnicodeString", "(", ...
Retrieves a prompt value. @param field field type @param block criteria data block @return prompt value
[ "Retrieves", "a", "prompt", "value", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L415-L425
train
joniles/mpxj
src/main/java/net/sf/mpxj/synchro/PredecessorReader.java
PredecessorReader.getRelationType
private RelationType getRelationType(int type) { RelationType result; if (type > 0 && type < RELATION_TYPES.length) { result = RELATION_TYPES[type]; } else { result = RelationType.FINISH_START; } return result; }
java
private RelationType getRelationType(int type) { RelationType result; if (type > 0 && type < RELATION_TYPES.length) { result = RELATION_TYPES[type]; } else { result = RelationType.FINISH_START; } return result; }
[ "private", "RelationType", "getRelationType", "(", "int", "type", ")", "{", "RelationType", "result", ";", "if", "(", "type", ">", "0", "&&", "type", "<", "RELATION_TYPES", ".", "length", ")", "{", "result", "=", "RELATION_TYPES", "[", "type", "]", ";", ...
Convert an integer to a RelationType instance. @param type integer value @return RelationType instance
[ "Convert", "an", "integer", "to", "a", "RelationType", "instance", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/PredecessorReader.java#L77-L89
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/FixFix.java
FixFix.getByteArrayValue
public byte[] getByteArrayValue(int index) { byte[] result = null; if (m_array[index] != null) { result = (byte[]) m_array[index]; } return (result); }
java
public byte[] getByteArrayValue(int index) { byte[] result = null; if (m_array[index] != null) { result = (byte[]) m_array[index]; } return (result); }
[ "public", "byte", "[", "]", "getByteArrayValue", "(", "int", "index", ")", "{", "byte", "[", "]", "result", "=", "null", ";", "if", "(", "m_array", "[", "index", "]", "!=", "null", ")", "{", "result", "=", "(", "byte", "[", "]", ")", "m_array", "...
This method retrieves a byte array containing the data at the given index in the block. If no data is found at the given index this method returns null. @param index index of the data item to be retrieved @return byte array containing the requested data
[ "This", "method", "retrieves", "a", "byte", "array", "containing", "the", "data", "at", "the", "given", "index", "in", "the", "block", ".", "If", "no", "data", "is", "found", "at", "the", "given", "index", "this", "method", "returns", "null", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FixFix.java#L97-L107
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Props.java
Props.getByte
public byte getByte(Integer type) { byte result = 0; byte[] item = m_map.get(type); if (item != null) { result = item[0]; } return (result); }
java
public byte getByte(Integer type) { byte result = 0; byte[] item = m_map.get(type); if (item != null) { result = item[0]; } return (result); }
[ "public", "byte", "getByte", "(", "Integer", "type", ")", "{", "byte", "result", "=", "0", ";", "byte", "[", "]", "item", "=", "m_map", ".", "get", "(", "type", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "result", "=", "item", "[", "0...
Retrieves a byte value from the property data. @param type Type identifier @return byte value
[ "Retrieves", "a", "byte", "value", "from", "the", "property", "data", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Props.java#L61-L72
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Props.java
Props.getTime
public Date getTime(Integer type) { Date result = null; byte[] item = m_map.get(type); if (item != null) { result = MPPUtility.getTime(item, 0); } return (result); }
java
public Date getTime(Integer type) { Date result = null; byte[] item = m_map.get(type); if (item != null) { result = MPPUtility.getTime(item, 0); } return (result); }
[ "public", "Date", "getTime", "(", "Integer", "type", ")", "{", "Date", "result", "=", "null", ";", "byte", "[", "]", "item", "=", "m_map", ".", "get", "(", "type", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "result", "=", "MPPUtility", ...
Retrieves a timestamp from the property data. @param type Type identifier @return timestamp
[ "Retrieves", "a", "timestamp", "from", "the", "property", "data", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Props.java#L137-L148
train
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/Props.java
Props.getUnicodeString
public String getUnicodeString(Integer type) { String result = null; byte[] item = m_map.get(type); if (item != null) { result = MPPUtility.getUnicodeString(item, 0); } return (result); }
java
public String getUnicodeString(Integer type) { String result = null; byte[] item = m_map.get(type); if (item != null) { result = MPPUtility.getUnicodeString(item, 0); } return (result); }
[ "public", "String", "getUnicodeString", "(", "Integer", "type", ")", "{", "String", "result", "=", "null", ";", "byte", "[", "]", "item", "=", "m_map", ".", "get", "(", "type", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "result", "=", "MP...
Retrieves a string value from the property data. @param type Type identifier @return string value
[ "Retrieves", "a", "string", "value", "from", "the", "property", "data", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Props.java#L194-L205
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeStartObject
public void writeStartObject(String name) throws IOException { writeComma(); writeNewLineIndent(); if (name != null) { writeName(name); writeNewLineIndent(); } m_writer.write("{"); increaseIndent(); }
java
public void writeStartObject(String name) throws IOException { writeComma(); writeNewLineIndent(); if (name != null) { writeName(name); writeNewLineIndent(); } m_writer.write("{"); increaseIndent(); }
[ "public", "void", "writeStartObject", "(", "String", "name", ")", "throws", "IOException", "{", "writeComma", "(", ")", ";", "writeNewLineIndent", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "writeName", "(", "name", ")", ";", "writeNewLineIn...
Begin writing a named object attribute. @param name attribute name
[ "Begin", "writing", "a", "named", "object", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L86-L99
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeStartList
public void writeStartList(String name) throws IOException { writeComma(); writeNewLineIndent(); writeName(name); writeNewLineIndent(); m_writer.write("["); increaseIndent(); }
java
public void writeStartList(String name) throws IOException { writeComma(); writeNewLineIndent(); writeName(name); writeNewLineIndent(); m_writer.write("["); increaseIndent(); }
[ "public", "void", "writeStartList", "(", "String", "name", ")", "throws", "IOException", "{", "writeComma", "(", ")", ";", "writeNewLineIndent", "(", ")", ";", "writeName", "(", "name", ")", ";", "writeNewLineIndent", "(", ")", ";", "m_writer", ".", "write",...
Begin writing a named list attribute. @param name attribute name
[ "Begin", "writing", "a", "named", "list", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L106-L114
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, String value) throws IOException { internalWriteNameValuePair(name, escapeString(value)); }
java
public void writeNameValuePair(String name, String value) throws IOException { internalWriteNameValuePair(name, escapeString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "String", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "escapeString", "(", "value", ")", ")", ";", "}" ]
Write a string attribute. @param name attribute name @param value attribute value
[ "Write", "a", "string", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L140-L143
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, int value) throws IOException { internalWriteNameValuePair(name, Integer.toString(value)); }
java
public void writeNameValuePair(String name, int value) throws IOException { internalWriteNameValuePair(name, Integer.toString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "int", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "Integer", ".", "toString", "(", "value", ")", ")", ";", "}" ]
Write an int attribute. @param name attribute name @param value attribute value
[ "Write", "an", "int", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L151-L154
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, long value) throws IOException { internalWriteNameValuePair(name, Long.toString(value)); }
java
public void writeNameValuePair(String name, long value) throws IOException { internalWriteNameValuePair(name, Long.toString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "long", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "Long", ".", "toString", "(", "value", ")", ")", ";", "}" ]
Write a long attribute. @param name attribute name @param value attribute value
[ "Write", "a", "long", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L162-L165
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, double value) throws IOException { internalWriteNameValuePair(name, Double.toString(value)); }
java
public void writeNameValuePair(String name, double value) throws IOException { internalWriteNameValuePair(name, Double.toString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "double", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "Double", ".", "toString", "(", "value", ")", ")", ";", "}" ]
Write a double attribute. @param name attribute name @param value attribute value
[ "Write", "a", "double", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L173-L176
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, Date value) throws IOException { internalWriteNameValuePair(name, m_format.format(value)); }
java
public void writeNameValuePair(String name, Date value) throws IOException { internalWriteNameValuePair(name, m_format.format(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "Date", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "m_format", ".", "format", "(", "value", ")", ")", ";", "}" ]
Write a Date attribute. @param name attribute name @param value attribute value
[ "Write", "a", "Date", "attribute", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L195-L198
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.internalWriteNameValuePair
private void internalWriteNameValuePair(String name, String value) throws IOException { writeComma(); writeNewLineIndent(); writeName(name); if (m_pretty) { m_writer.write(' '); } m_writer.write(value); }
java
private void internalWriteNameValuePair(String name, String value) throws IOException { writeComma(); writeNewLineIndent(); writeName(name); if (m_pretty) { m_writer.write(' '); } m_writer.write(value); }
[ "private", "void", "internalWriteNameValuePair", "(", "String", "name", ",", "String", "value", ")", "throws", "IOException", "{", "writeComma", "(", ")", ";", "writeNewLineIndent", "(", ")", ";", "writeName", "(", "name", ")", ";", "if", "(", "m_pretty", ")...
Core write attribute implementation. @param name attribute name @param value attribute value
[ "Core", "write", "attribute", "implementation", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L206-L218
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.escapeString
private String escapeString(String value) { m_buffer.setLength(0); m_buffer.append('"'); for (int index = 0; index < value.length(); index++) { char c = value.charAt(index); switch (c) { case '"': { m_buffer.append("\\\""); ...
java
private String escapeString(String value) { m_buffer.setLength(0); m_buffer.append('"'); for (int index = 0; index < value.length(); index++) { char c = value.charAt(index); switch (c) { case '"': { m_buffer.append("\\\""); ...
[ "private", "String", "escapeString", "(", "String", "value", ")", "{", "m_buffer", ".", "setLength", "(", "0", ")", ";", "m_buffer", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "index", "=", "0", ";", "index", "<", "value", ".", "len...
Escape text to ensure valid JSON. @param value value @return escaped value
[ "Escape", "text", "to", "ensure", "valid", "JSON", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L226-L296
train
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeComma
private void writeComma() throws IOException { if (m_firstNameValuePair.peek().booleanValue()) { m_firstNameValuePair.pop(); m_firstNameValuePair.push(Boolean.FALSE); } else { m_writer.write(','); } }
java
private void writeComma() throws IOException { if (m_firstNameValuePair.peek().booleanValue()) { m_firstNameValuePair.pop(); m_firstNameValuePair.push(Boolean.FALSE); } else { m_writer.write(','); } }
[ "private", "void", "writeComma", "(", ")", "throws", "IOException", "{", "if", "(", "m_firstNameValuePair", ".", "peek", "(", ")", ".", "booleanValue", "(", ")", ")", "{", "m_firstNameValuePair", ".", "pop", "(", ")", ";", "m_firstNameValuePair", ".", "push"...
Write a comma to the output stream if required.
[ "Write", "a", "comma", "to", "the", "output", "stream", "if", "required", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L301-L312
train