FileDocCategorySizeDatePackage
RuleBasedBreakIterator.javaAPI DocAndroid 1.5 API3521Wed May 06 22:41:04 BST 2009com.ibm.icu4jni.text

RuleBasedBreakIterator

public class RuleBasedBreakIterator extends BreakIterator

Fields Summary
private CharacterIterator
charIter
private int
addr
Constructors Summary
RuleBasedBreakIterator(int iterAddr, int type)

        this.addr = iterAddr;
        this.type = type;
        this.charIter = new StringCharacterIterator("");
    
Methods Summary
public java.lang.Objectclone()

        int cloneAddr = NativeBreakIterator.cloneImpl(this.addr);
        RuleBasedBreakIterator rbbi = 
                new RuleBasedBreakIterator(cloneAddr, this.type);
        
        rbbi.charIter = this.charIter;
        
        return rbbi;
    
public intcurrent()

        return NativeBreakIterator.currentImpl(this.addr);
    
public booleanequals(java.lang.Object object)

        if(object == null) {
            return false;
        }
        
        if(!(object instanceof RuleBasedBreakIterator)) {
            return false;
        }
        
        CharacterIterator iter = ((RuleBasedBreakIterator) object).charIter;
        
        boolean result = this.type == ((RuleBasedBreakIterator) object).type;
        
        return result && iter.equals(this.charIter);
    
protected voidfinalize()

        NativeBreakIterator.closeBreakIteratorImpl(this.addr);
    
public intfirst()

        return NativeBreakIterator.firstImpl(this.addr);
    
public intfollowing(int offset)

        return NativeBreakIterator.followingImpl(this.addr, offset);
    
public java.text.CharacterIteratorgetText()

        int newLoc = NativeBreakIterator.currentImpl(this.addr);
        this.charIter.setIndex(newLoc);
        return this.charIter;
    
public booleanisBoundary(int offset)

        return NativeBreakIterator.isBoundaryImpl(this.addr, offset);
    
public intlast()

        return NativeBreakIterator.lastImpl(this.addr);
    
public intnext()

        return NativeBreakIterator.nextImpl(this.addr, 1);
    
public intnext(int n)

        return NativeBreakIterator.nextImpl(this.addr, n);
    
public intpreceding(int offset)

        return NativeBreakIterator.precedingImpl(this.addr, offset);
    
public intprevious()

        return NativeBreakIterator.previousImpl(this.addr);
    
public voidsetText(java.text.CharacterIterator newText)

        this.charIter = newText;

        StringBuilder sb = new StringBuilder();
        
        char c = newText.first();
        while(c != CharacterIterator.DONE) {
            sb.append(c);
            c = newText.next();
        }

        NativeBreakIterator.setTextImpl(this.addr, sb.toString());