needs: * supply fixed ascii explains American
/**
* needs:
* supply fixed ascii explains American character and where the target index is
* new scanne is designed as a new sheet table store sheet index called sheet_index_character_scanne
* and index to a sheet is sheet_character_scanne
* zone injection is to get right target cordination character
* zone is 1 meters high
* width is 0 meter
* hight is 0 meter
* zone is covering this injection area
* inputs hook integer list hook charecter to get relative character is where index,String word is the real
* word to handle this case
* constraints:
* key word length is less equal than 7 character length
* index key word is index target integer begin with 0 and end with 255
* index tabel is limit to 26 character number count
* @param h
* @param word
* @return
*/
public static int personalPdfViewer(List<Integer> h, String word) {
int retFlag=hookListAndWordCheckValidation(h,word);
if(retFlag==0) {
return 0;
}
int retFlagInt=findRightTargetIndexFroWordZoneInjection(h, word);
if(retFlagInt==0) {
return 0;
}
int retFlagCheckFirst=firstInicializeIndexLibAndLinkedSheetDocumentLib(h,word);
if(retFlagCheckFirst==0) {
return 0;
}
int retIndexFlag=0;
int retIntResult=0;
int count=0;
while(true) {
retIndexFlag=firstInicializeIndexLibAndLinkedSheetDocumentLib(h, word);
if(retIndexFlag==0) {
return 0;
}
int retIntFlagDynimic=dynimic2UpdataIndexLibAndLinkedSheetDocumentLib(h,word);
if(retIntFlagDynimic==0) {
return 0;
}
retIntResult=findRightTargetIndexFroWordZoneInjection(h, word);
count++;
if(count>1000000) {
break;
}
}
return retIntResult;
}
/**
* check normal inputs is right or not data
* @param h
* @param word
*/
public static int hookListAndWordCheckValidation(List<Integer> h, String word) {
if(h==null) {
return 0;
}
if(h.isEmpty()) {
return 0;
}
if(word==null) {
return 0;
}
if(word.isEmpty()) {
return 0;
}
String newWordTemp=word.trim();
if(newWordTemp.isEmpty()) {
return 0;
}
int hookListSize=h.size();
if(hookListSize<0 || hookListSize>26) {
return 0;
}
for (int i = 0; i < h.size(); i++) {
int indexIntegerTarget=h.get(i);
if(indexIntegerTarget<0 || indexIntegerTarget>255) {
return 0;
}
}
if(word.length()<1 || word.length()>7) {
return 0;
}
return 1;
}
/**
* inicialize index lib and linked sheet document lib data
* using new scanne cordinaiton data
*/
public static int firstInicializeIndexLibAndLinkedSheetDocumentLib(List<Integer> h, String word) {
/**
* first time check table if can't find the right index and using word as a new target index
* and update to index lib
*/
hookListAndWordCheckValidation(h,word);
return 0;
}
/**
* if can't find word stored index
* analyze word and stored to relative area and generate out a index target update to
* inicialize sheet document index
* or not
* invoke firstInicializeIndeLibAndLinkedSheetDocumentLib(h,word) to find right target index for where
* the zone injection word is
*/
public static int dynimic2UpdataIndexLibAndLinkedSheetDocumentLib(List<Integer> h, String word) {
hookListAndWordCheckValidation(h,word);
return 0;
}
/**
* check index sheet document table by using key word
* get right sheet document key word index
* @param h
* @param word
* @return
*/
public static int findRightTargetIndexFroWordZoneInjection(List<Integer> h, String word) {
int findRightTargetValidationFlag=hookListAndWordCheckValidation(h,word);
if(findRightTargetValidationFlag==0) {
return 0;
}
return 1;
}
/**
* by using hook integer list contains integer tag
* corperate with target zone injection word to build oop key word linked to hook index integer tag
* as index sheet document lib
* @param h
* @param word
*/
public static void firstTime2BuildSheetDocumentIndexLib(List<Integer> h, String word) {
int retFlag=findRightTargetIndexFroWordZoneInjection(h,word);
}
class SheetDocumentIndex{
private String id;
private String name;
private Integer sheetDocumentIndexACSIITarget;
private Integer sheetDocumentIndex;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getSheetDocumentIndexACSIITarget() {
return sheetDocumentIndexACSIITarget;
}
public void setSheetDocumentIndexACSIITarget(Integer sheetDocumentIndexACSIITarget) {
this.sheetDocumentIndexACSIITarget = sheetDocumentIndexACSIITarget;
}
public Integer getSheetDocumentIndex() {
return sheetDocumentIndex;
}
public void setSheetDocumentIndex(Integer sheetDocumentIndex) {
this.sheetDocumentIndex = sheetDocumentIndex;
}
}
class SheetDocument{
private String id;
private String name;
private String sheetDocumentIndexId;
private String zoneInjectionId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSheetDocumentIndexId() {
return sheetDocumentIndexId;
}
public void setSheetDocumentIndexId(String sheetDocumentIndexId) {
this.sheetDocumentIndexId = sheetDocumentIndexId;
}
}
class ZoneInjection{
private String id;
private String name;
private Integer zoneInjectionHight=1;//third dimetion injection cordination height is fixed to 1 meter high
private Integer zoneInjectionWith=0;//injection zone is a pipe begain with slim channel as 0 meter width
private Integer zoneInjectionHeight=0;// same as no height
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getZoneInjectionHight() {
return zoneInjectionHight;
}
public void setZoneInjectionHight(Integer zoneInjectionHight) {
this.zoneInjectionHight = zoneInjectionHight;
}
public Integer getZoneInjectionWith() {
return zoneInjectionWith;
}
public void setZoneInjectionWith(Integer zoneInjectionWith) {
this.zoneInjectionWith = zoneInjectionWith;
}
public Integer getZoneInjectionHeight() {
return zoneInjectionHeight;
}
public void setZoneInjectionHeight(Integer zoneInjectionHeight) {
this.zoneInjectionHeight = zoneInjectionHeight;
}
}
class ZoneInjectionCharacter{
private String id;
private String name;
private String zoneInjectionId;
private Character zoneInjectionCharacter;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getZoneInjectionId() {
return zoneInjectionId;
}
public void setZoneInjectionId(String zoneInjectionId) {
this.zoneInjectionId = zoneInjectionId;
}
public Character getZoneInjectionCharacter() {
return zoneInjectionCharacter;
}
public void setZoneInjectionCharacter(Character zoneInjectionCharacter) {
this.zoneInjectionCharacter = zoneInjectionCharacter;
}
}
Java技术 文章被收录于专栏
JavaEE技术 编程开发经验 企业通用技术
查看18道真题和解析