1053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project/* 2053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Copyright (C) 2008,2009 OMRON SOFTWARE Co., Ltd. 3053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 4053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 5053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * you may not use this file except in compliance with the License. 6053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * You may obtain a copy of the License at 7053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 8053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 9053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 10053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Unless required by applicable law or agreed to in writing, software 11053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 12053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * See the License for the specific language governing permissions and 14053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * limitations under the License. 15053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 16053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 17053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Projectpackage jp.co.omronsoft.openwnn; 18053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 19053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project/** 20d56eddfd5e0f193359f93e7ef665338cace9e2e9Daisuke Miyakawa * The information container class of segment in a string. 21d56eddfd5e0f193359f93e7ef665338cace9e2e9Daisuke Miyakawa * 22053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * This class defines information of a segment in a string, such as a character, a word or a clause. 23f96267ad0d85ede52c300ae5456d7e4ecb50915cDaisuke Miyakawa * It is used to represent the layers of the composing text ({@link ComposingText}). 24053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 25d56eddfd5e0f193359f93e7ef665338cace9e2e9Daisuke Miyakawa * @author Copyright (C) 2009 OMRON SOFTWARE CO., LTD. All rights reserved. 26053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 27053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Projectpublic class StrSegment { 28053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** The string */ 29053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public String string; 30053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** The start position */ 31053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public int from; 32053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** The end position */ 33053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public int to; 34053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 35053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** 36053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Constructor 37053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 38053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public StrSegment() { 39053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this(null, -1, -1); 40053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project } 41053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 42053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** 43053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Constructor 44053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 45053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * @param str The string 46053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 47053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public StrSegment(String str) { 48053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this(str, -1, -1); 49053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project } 50053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 51053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** 52053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Constructor 53053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 54053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * @param chars The array of characters 55053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 56053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public StrSegment(char[] chars) { 57053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this(new String(chars), -1, -1); 58053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project } 59053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project 60053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project /** 61053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * Constructor 62053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * 63053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * @param str The string 64053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * @param from The start position 65053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project * @param to The end position 66053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project */ 67053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project public StrSegment(String str, int from, int to) { 68053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this.string = str; 69053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this.from = from; 70053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project this.to = to; 71053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project } 72053d50935e0e311286543bd7c535ae2c863c0deThe Android Open Source Project} 73