1 22 23 package org.jboss.tutorial.spring; 24 25 28 public class StaticWordsCreator implements WordsCreator 29 { 30 31 private static final String [] words = { 32 "Java", 33 "Enterprise", 34 "Beans", 35 "Word", 36 "Create", 37 "Spring", 38 "JBoss", 39 }; 40 41 private int counter; 42 43 protected String [] getArray() 44 { 45 return words; 46 } 47 48 protected String getNext() 49 { 50 String [] array = getArray(); 51 return array[(counter++) % array.length]; 52 } 53 54 public String createWord() 55 { 56 return getNext(); 57 } 58 59 } 60 | Popular Tags |