1 24 25 package com.mckoi.database.global; 26 27 import java.io.Reader ; 28 import java.io.StringReader ; 29 30 36 37 public class StringObject implements java.io.Serializable , StringAccessor { 38 39 static final long serialVersionUID = 6066215992031250481L; 40 41 44 private String str; 45 46 49 private StringObject(String str) { 50 this.str = str; 51 } 52 53 56 public int length() { 57 return str.length(); 58 } 59 60 63 public Reader getReader() { 64 return new StringReader (str); 65 } 66 67 70 public String toString() { 71 return str; 72 } 73 74 77 public static StringObject fromString(String str) { 78 if (str != null) { 79 return new StringObject(str); 80 } 81 return null; 82 } 83 84 } 85 86 | Popular Tags |