1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 import com.sun.star.lang.Locale; 25 26 public class XHyphenatedWord_impl implements 27 com.sun.star.linguistic2.XHyphenatedWord 28 { 29 String aWord; 30 String aHyphenatedWord; 31 short nHyphenPos; 32 short nHyphenationPos; 33 Locale aLang; 34 boolean bIsAltSpelling; 35 XHyphenatedWord_impl( String aWord, Locale aLang, short nHyphenationPos, String aHyphenatedWord, short nHyphenPos )36 public XHyphenatedWord_impl( 37 String aWord, 38 Locale aLang, 39 short nHyphenationPos, 40 String aHyphenatedWord, 41 short nHyphenPos ) 42 { 43 this.aWord = aWord; 44 this.aLang = aLang; 45 this.nHyphenationPos = nHyphenationPos; 46 this.aHyphenatedWord = aHyphenatedWord; 47 this.nHyphenPos = nHyphenPos; 48 this.bIsAltSpelling = (aWord != aHyphenatedWord); 49 50 //!! none of these cases should ever occur! 51 //!! values provided only for safety 52 if (this.aWord == null) 53 this.aWord = new String(); 54 if (this.aLang == null) 55 this.aLang = new Locale(); 56 if (this.aHyphenatedWord == null) 57 this.aHyphenatedWord = new String(); 58 } 59 60 61 // XHyphenatedWord getWord()62 public String getWord() throws com.sun.star.uno.RuntimeException 63 { 64 return aWord; 65 } getLocale()66 public Locale getLocale() throws com.sun.star.uno.RuntimeException 67 { 68 return aLang; 69 } getHyphenationPos()70 public short getHyphenationPos() throws com.sun.star.uno.RuntimeException 71 { 72 return nHyphenationPos; 73 } getHyphenatedWord()74 public String getHyphenatedWord() throws com.sun.star.uno.RuntimeException 75 { 76 return aHyphenatedWord; 77 } getHyphenPos()78 public short getHyphenPos() throws com.sun.star.uno.RuntimeException 79 { 80 return nHyphenPos; 81 } isAlternativeSpelling()82 public boolean isAlternativeSpelling() throws com.sun.star.uno.RuntimeException 83 { 84 return bIsAltSpelling; 85 } 86 }; 87