/** * Populates the {@link MLChar} with the {@link String} value. * @param value the String value */ public void set(String value) { char[] cha = value.toCharArray(); for ( int i = 0; i < getN() && i < value.length(); i++ ) { setChar(cha[i], i); } }
/** * Populates the {@link MLChar} with the {@link String} value. * @param value the String value */ public void set(String value) { char[] cha = value.toCharArray(); for ( int i = 0; i < getN() && i < value.length(); i++ ) { setChar(cha[i], i); } }
/** * Populates the {@link MLChar} with the {@link String} value. * @param value the String value */ public void set(String value) { char[] cha = value.toCharArray(); for (int i = 0; i < getN() && i < value.length(); i++) { setChar(cha[i], i); } }
/** * Gets the m-th character matrix's row as <code>String</code>. * * @param m - row number * @return - <code>String</code> */ public String getString(int m) { StringBuffer charbuff = new StringBuffer(); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } return charbuff.toString().trim(); }
public MLChar(String name, int[] dims, int type, int attributes) { super(name, dims, type, attributes); chars = new Character[getM() * getN()]; }
/** * Gets the m-th character matrix's row as <code>String</code>. * * @param m - row number * @return - <code>String</code> */ public String getString(int m) { StringBuffer charbuff = new StringBuffer(); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } return charbuff.toString().trim(); }
/** * Populates the {@link MLChar} with the {@link String} value. * @param value the String value */ public void set(String value) { char[] cha = value.toCharArray(); for (int i = 0; i < getN() && i < value.length(); i++) { setChar(cha[i], i); } }
/** * Populates the {@link MLChar} with the {@link String} value. * @param value the String value */ public void set(String value) { char[] cha = value.toCharArray(); for ( int i = 0; i < getN() && i < value.length(); i++ ) { setChar(cha[i], i); } }
public MLChar(String name, int[] dims, int type, int attributes) { super(name, dims, type, attributes); chars = new Character[getM() * getN()]; }
/** * Gets the m-th character matrix's row as <code>String</code>. * * @param m - row number * @return - <code>String</code> */ public String getString( int m ) { StringBuffer charbuff = new StringBuffer(); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } return charbuff.toString().trim(); }
/** * Gets the m-th character matrix's row as <code>String</code>. * * @param m - row number * @return - <code>String</code> */ public String getString( int m ) { StringBuffer charbuff = new StringBuffer(); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } return charbuff.toString().trim(); }
/** * Gets the m-th character matrix's row as <code>String</code>. * * @param m - row number * @return - <code>String</code> */ public String getString( int m ) { StringBuffer charbuff = new StringBuffer(); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } return charbuff.toString().trim(); }
public static String MLCharToString(MLChar mlchar) { StringBuffer sb = new StringBuffer(); for (int m = 0; m < mlchar.getM(); m++) { for (int n = 0; n < mlchar.getN(); n++) { sb.append(mlchar.getChar(m, n)); } } return sb.toString(); }
public String contentToString() { StringBuffer sb = new StringBuffer(); sb.append(name + " = \n"); for (int m = 0; m < getM(); m++) { sb.append("\t"); StringBuffer charbuff = new StringBuffer(); charbuff.append("'"); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } charbuff.append("'"); sb.append(charbuff); sb.append("\n"); } return sb.toString(); } }
public String contentToString() { StringBuffer sb = new StringBuffer(); sb.append(name + " = \n"); for (int m = 0; m < getM(); m++) { sb.append("\t"); StringBuffer charbuff = new StringBuffer(); charbuff.append("'"); for (int n = 0; n < getN(); n++) { charbuff.append(getChar(m, n)); } charbuff.append("'"); sb.append(charbuff); sb.append("\n"); } return sb.toString(); } }
public MLChar(String name, int[] dims, int type, int attributes) { super(name, dims, type, attributes); chars = createArray(getM(), getN()); }
public MLChar(String name, int[] dims, int type, int attributes) { super(name, dims, type, attributes); chars = createArray(getM(), getN()); }
public MLChar(String name, int[] dims, int type, int attributes) { super(name, dims, type, attributes); chars = createArray(getM(), getN()); }
/** * Set one row, specifying the row. * * @param value * @param idx */ public void set(String value, int idx) { int rowOffset = getM(); for (int i = 0; i < getN(); i++) { if (i < value.length()) { setChar(value.charAt(i), idx + (rowOffset * i)); } else { setChar(' ', idx + (rowOffset * i)); } } }
/** * Set one row, specifying the row. * * @param value * @param idx */ public void set(String value, int idx) { int rowOffset = getM(); for (int i = 0; i < getN(); i++) { if (i < value.length()) { setChar(value.charAt(i), idx + (rowOffset * i)); } else { setChar(' ', idx + (rowOffset * i)); } } }