public String getBeforeIndex(byte type, int index)
			{
				if (index < 0 || index > getText().length() - 1)
					{
						return null;
					}
				switch (type)
					{
					case CHARACTER:
						if (index == 0)
							{
								return null;
							}
						return getText().substring(index - 1, index);
					case WORD:
						{
							String s = this.getText();
							BreakIterator words = BreakIterator.getWordInstance();
							words.setText(s);
							int end = findWordLimit(index, words, PREVIOUS, s);
							if (end == BreakIterator.DONE)
								{
									return null;
								}
							int start = words.preceding(end);
							if (start == BreakIterator.DONE)
								{
									return null;
								}
							return s.substring(start, end);
						}
					case SENTENCE:
						{
							String s = getText();
							BreakIterator sentence = BreakIterator.getSentenceInstance();
							sentence.setText(s);
							int end = sentence.following(index);
							end = sentence.previous();
							int start = sentence.previous();
							if (start == BreakIterator.DONE)
								{
									return null;
								}
							return s.substring(start, end);
						}
					default:
						return null;
					}
			}