Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Conversion
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vladislav Kiselev
Conversion
Commits
279c47b5
Commit
279c47b5
authored
Aug 08, 2019
by
Vladislav Kiselev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавлено словесное описание как часть задачи.
parent
43fbfdfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
src/inport/TaskCase.java
src/inport/TaskCase.java
+27
-0
No files found.
src/inport/TaskCase.java
View file @
279c47b5
...
...
@@ -74,6 +74,16 @@ public class TaskCase {
// План - решение
private
List
<
Operation
>
solution
;
// Словесное описание.
private
StringBuilder
description
;
public
StringBuilder
getDescription
()
{
return
description
;
}
public
void
setDescription
(
StringBuilder
description
)
{
this
.
description
=
description
;
}
public
List
<
Operation
>
getFixedOperations
()
{
return
fixedOperations
;
}
...
...
@@ -423,6 +433,7 @@ public class TaskCase {
fixedOperations
=
new
ArrayList
<>();
solution
=
new
ArrayList
<>();
description
=
new
StringBuilder
();
}
private
MovingObjectState
fromString
(
String
s
,
...
...
@@ -442,6 +453,7 @@ public class TaskCase {
private
enum
Tag
{
Undefined
(
""
),
Description
(
"Description"
),
Typified
(
"Typified"
),
Cargoes
(
"Cargoes"
),
Berths
(
"Berths"
),
...
...
@@ -485,6 +497,7 @@ public class TaskCase {
bunkerTypes
.
clear
();
fixedOperations
.
clear
();
solution
.
clear
();
description
=
new
StringBuilder
();
// Open the file
FileInputStream
fstream
;
...
...
@@ -515,11 +528,17 @@ public class TaskCase {
if
(
serviceString
||
strLine
.
trim
().
isEmpty
()
||
tag
==
Tag
.
Undefined
||
strLine
.
startsWith
(
"/*"
))
{
numInside
=
0
;
if
(
tag
.
equals
(
Tag
.
Description
)
&&
((
strLine
.
trim
().
isEmpty
())
||
(
strLine
.
startsWith
(
"/*"
))))
{
description
.
append
(
strLine
).
append
(
"\n"
);
}
continue
;
}
String
[]
tokens
;
switch
(
tag
)
{
case
Description:
description
.
append
(
strLine
).
append
(
"\n"
);
break
;
case
Typified:
typified
=
strLine
.
trim
().
equals
(
"1"
);
break
;
case
Cargoes:
Cargo
c
=
new
Cargo
(
strLine
);
cargoes
.
add
(
c
);
m_cargo
.
put
(
c
.
getId
(),
c
);
...
...
@@ -747,6 +766,14 @@ public class TaskCase {
try
(
FileWriter
writer
=
new
FileWriter
(
fileName
,
false
))
{
// запись всего
{
String
d
=
description
.
toString
();
writer
.
write
(
Tag
.
Description
.
text
+
"\n"
+
d
);
if
((
d
.
isEmpty
())
||
((
d
.
length
()
>
1
)
&&
(
d
.
charAt
(
d
.
length
()
-
2
)
!=
'\n'
)))
{
writer
.
write
(
"\n"
);
}
}
writer
.
write
(
Tag
.
Typified
.
text
+
"\n"
+
(
isTypified
()?
"1"
:
"0"
)
+
"\n"
);
writer
.
write
(
"\nCargoes"
+
"\n"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment