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