소스 검색

Methode isLastElementANumber erstellt.

testBranch
Ileana Krontsi 10 년 전
committed by ikrontsi
부모
커밋
dba99b1ccb
1개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. +16
    -4
      src/main/java/de/uniluebeck/mi/projmi6/model/Icd10Code.java

+ 16
- 4
src/main/java/de/uniluebeck/mi/projmi6/model/Icd10Code.java 파일 보기

@@ -1,5 +1,5 @@
package de.uniluebeck.mi.projmi6.model;
import java.io.*;
/**
* A simple, immutable class that wraps an ICD10 code entry from the db.
*/
@@ -12,7 +12,7 @@ public class Icd10Code {
private final int version;


public Icd10Code(String icd10Code, String text, int version){
public Icd10Code(String icd10Code, String text, int version) {
this.code = icd10Code;
this.text = text;
this.version = version;
@@ -32,6 +32,18 @@ public class Icd10Code {

@Override
public String toString() {
return code+" - "+ text;
return code + " - " + text;
}
}


public boolean isLastElementANumber(Icd10Code icd10code) {
String lastElement = icd10code.getCode().substring(icd10code.getCode().length() - 1);
boolean isNumber = false;
char[] lastEl = lastElement.toCharArray();
if (Character.isDigit(lastEl[0])) {
isNumber = true;
}
return isNumber;
}

}

불러오는 중...
취소
저장