adding all of botlist, initial add
[botlist.git] / openbotlist / src / org / spirit / servlet / bean / BotListConcatValue.java
blob90e7eabba2296f789751d9fc62e8b22da1c6d96e
1 /**
2 * Berlin Brown
3 * Dec 29, 2006
4 */
5 package org.spirit.servlet.bean;
7 import java.io.Serializable;
9 /**
10 * This is class is used by botverse.
11 * @author Berlin Brown
14 public class BotListConcatValue implements Serializable {
16 /**
19 private static final long serialVersionUID = -4007269620924320835L;
21 public final static int DEFAULT_MAX_LEN = 10;
23 /**
24 * Synomous with value
26 private String word;
27 private int maxLen = -1;
29 /**
30 * @return the maxLen
32 public int getMaxLen() {
33 if (maxLen <= 0) {
34 maxLen = DEFAULT_MAX_LEN;
36 return maxLen;
38 /**
39 * @param maxLen the maxLen to set
41 public void setMaxLen(int maxLen) {
42 this.maxLen = maxLen;
45 /**
46 * @return the word
48 public String getWord() {
49 if (word != null && (word.length() > (maxLen + 3))) {
50 word = word.substring(0, (maxLen - 1)) + "...";
52 return word;
55 public final static String getMaxWord(String value, Integer curMaxLenI) {
56 int curMaxLen = curMaxLenI.intValue();
57 String curWord = value;
58 if (value != null && (value.length() > (curMaxLen + 3))) {
59 curWord = value.substring(0, (curMaxLen - 1)) + "...";
61 return curWord;
64 /**
65 * @param word the word to set
67 public void setWord(String word) {
68 this.word = word;