fix: fixing some syntax errors (part 1)
This commit is contained in:
@@ -41,6 +41,11 @@
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-csv</artifactId>
|
||||
<version>1.14.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -24,9 +24,10 @@ public class FileDataSource implements DataSource{
|
||||
MyList<Student> resultList = new MyLinkedList<>();
|
||||
try {
|
||||
StudentCsvReader reader = new StudentCsvReader(fileName);
|
||||
while reader.hasNext() {
|
||||
result.append(reader.next());
|
||||
while (reader.hasNext()) {
|
||||
resultList.add(reader.next());
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
catch (IllegalArgumentException e){
|
||||
System.out.println(e.getMessage());
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.nio.file.StandardOpenOption;
|
||||
import ru.project.student.Student;
|
||||
import ru.project.collection.MyList;
|
||||
import ru.project.collection.MyLinkedList;
|
||||
import ru.project.collection.Iterator;
|
||||
//import ru.project.collection.Iterator;
|
||||
|
||||
public class FileWriter {
|
||||
private Path path;
|
||||
@@ -24,11 +24,11 @@ public class FileWriter {
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.APPEND
|
||||
)) {
|
||||
Iterator iterator = list.getIterator();
|
||||
/*Iterator iterator = list.getIterator();
|
||||
while (iterator.hasNext()){
|
||||
writer.write(iterator.next().toFileString());
|
||||
writer.newLine();
|
||||
}
|
||||
}*/
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ public class ManualDataSource implements DataSource{
|
||||
String groupNumber,
|
||||
double averageGrade,
|
||||
int recordBookNumber
|
||||
){}
|
||||
){
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public MyList<Student> create() {
|
||||
MyList<Student> result = new MyLinkedList<>();
|
||||
|
||||
@@ -20,7 +20,7 @@ public class RandomDataSource implements DataSource{
|
||||
}
|
||||
|
||||
private String getRandomGroupNumber(Random random){
|
||||
char prefix = (char)(random.nextInt(26) + (int)'A')4
|
||||
char prefix = (char)(random.nextInt(26) + (int)'A');
|
||||
String result = prefix + String.format("%02d", random.nextInt(100));
|
||||
return result;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class RandomDataSource implements DataSource{
|
||||
@Override
|
||||
public MyList<Student> create() {
|
||||
if (upperBounRecordBookNumber < 0)
|
||||
throw new IllegalException("The upper bound is negative!!!");
|
||||
throw new IllegalArgumentException("The upper bound is negative!!!");
|
||||
Random random = new Random();
|
||||
MyList<Student> result = new MyLinkedList<>();
|
||||
for (short i = 0; i<size; i++){
|
||||
|
||||
Reference in New Issue
Block a user