CloneSet531


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
68250.969class_body_declarations[10]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
16834
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/DocumentCharacterIterator.java
26725
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/SequenceCharacterIterator.java
Clone Instance
1
Line Count
68
Source Line
34
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/DocumentCharacterIterator.java

        private int fIndex = -1;

        private final IDocument fDocument;

        private final int fFirst;

        private final int fLast;

        private void invariant() {
                Assert.isTrue(fIndex >= fFirst);
                Assert.isTrue(fIndex <= fLast);
        }

        /**
         * Creates an iterator for the entire document.
         *
         * @param document the document backing this iterator
         */
        public DocumentCharacterIterator(IDocument document) {
                this(document, 0);
        }

        /**
         * Creates an iterator, starting at offset <code>first</code>.
         *
         * @param document the document backing this iterator
         * @param first the first character to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
        public DocumentCharacterIterator(IDocument document, int first) throws IllegalArgumentException {
                this(document, first, document.getLength());
        }

        /**
         * Creates an iterator for the document contents from <code>first</code>
         * (inclusive) to <code>last</code> (exclusive).
         *
         * @param document the document backing this iterator
         * @param first the first character to consider
         * @param last the last character index to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
        public DocumentCharacterIterator(IDocument document, int first, int last) throws IllegalArgumentException {
                if (document == null)
                        throw new NullPointerException();
                if (first < 0 || first > last)
                        throw new IllegalArgumentException();
                if (last > document.getLength())
                        throw new IllegalArgumentException();
                fDocument = document;
                fFirst = first;
                fLast = last;
                fIndex = first;
                invariant();
        }

        /*
         * @see java.text.CharacterIterator#first()
         */
        public char first() {
                return setIndex(getBeginIndex());
        }

        /*
         * @see java.text.CharacterIterator#last()
         */
        public char last() {
                if (fFirst == fLast)
                        return setIndex(getEndIndex());
                else
                        return setIndex(getEndIndex() - 1);
        }


Clone Instance
2
Line Count
67
Source Line
25
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/SequenceCharacterIterator.java

        private int fIndex = -1;

        private final CharSequence fSequence;

        private final int fFirst;

        private final int fLast;

        private void invariant() {
                Assert.isTrue(fIndex >= fFirst);
                Assert.isTrue(fIndex <= fLast);
        }

        /**
         * Creates an iterator for the entire sequence.
         *
         * @param sequence the sequence backing this iterator
         */
        public SequenceCharacterIterator(CharSequence sequence) {
                this(sequence, 0);
        }

        /**
         * Creates an iterator.
         *
         * @param sequence the sequence backing this iterator
         * @param first the first character to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
        public SequenceCharacterIterator(CharSequence sequence, int first) throws IllegalArgumentException {
                this(sequence, first, sequence.length());
        }

        /**
         * Creates an iterator.
         *
         * @param sequence the sequence backing this iterator
         * @param first the first character to consider
         * @param last the last character index to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
        public SequenceCharacterIterator(CharSequence sequence, int first, int last) throws IllegalArgumentException {
                if (sequence == null)
                        throw new NullPointerException();
                if (first < 0 || first > last)
                        throw new IllegalArgumentException();
                if (last > sequence.length())
                        throw new IllegalArgumentException();
                fSequence = sequence;
                fFirst = first;
                fLast = last;
                fIndex = first;
                invariant();
        }

        /*
         * @see java.text.CharacterIterator#first()
         */
        public char first() {
                return setIndex(getBeginIndex());
        }

        /*
         * @see java.text.CharacterIterator#last()
         */
        public char last() {
                if (fFirst == fLast)
                        return setIndex(getEndIndex());
                else
                        return setIndex(getEndIndex() - 1);
        }


Clone AbstractionParameter Count: 5Parameter Bindings

private int fIndex = -1;

private final [[#variable97f0b1a0]]  [[#variable97f0b0e0]];

private final int fFirst;

private final int fLast;

private void invariant() {
  Assert.isTrue(fIndex >= fFirst);
  Assert.isTrue(fIndex <= fLast);
}

/**
         * Creates an iterator for the entire document.
         *
         * @param document the document backing this iterator
         */
/**
         * Creates an iterator for the entire sequence.
         *
         * @param sequence the sequence backing this iterator
         */
public [[#variable564a99a0]]( [[#variable97f0b1a0]]  [[#variable97f0afe0]]) {
  this( [[#variable97f0afe0]], 0);
}

/**
         * Creates an iterator, starting at offset <code>first</code>.
         *
         * @param document the document backing this iterator
         * @param first the first character to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
/**
         * Creates an iterator.
         *
         * @param sequence the sequence backing this iterator
         * @param first the first character to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
public [[#variable564a99a0]]( [[#variable97f0b1a0]]  [[#variable97f0afe0]], int first) throws IllegalArgumentException {
  this( [[#variable97f0afe0]], first,  [[#variable97f0afe0]]. [[#variable97f0afc0]]());
}

/**
         * Creates an iterator for the document contents from <code>first</code>
         * (inclusive) to <code>last</code> (exclusive).
         *
         * @param document the document backing this iterator
         * @param first the first character to consider
         * @param last the last character index to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
/**
         * Creates an iterator.
         *
         * @param sequence the sequence backing this iterator
         * @param first the first character to consider
         * @param last the last character index to consider
         * @throws IllegalArgumentException if the indices are out of bounds
         */
public [[#variable564a99a0]]( [[#variable97f0b1a0]]  [[#variable97f0afe0]], int first, int last) throws IllegalArgumentException {
  if ( [[#variable97f0afe0]]== null)
    throw new NullPointerException();
  if (first < 0 || first > last)
    throw new IllegalArgumentException();
  if (last >  [[#variable97f0afe0]]. [[#variable97f0afc0]]())
    throw new IllegalArgumentException();
   [[#variable97f0b0e0]]= [[#variable97f0afe0]];
  fFirst = first;
  fLast = last;
  fIndex = first;
  invariant();
}

/*
         * @see java.text.CharacterIterator#first()
         */
public char first() {
  return setIndex(getBeginIndex());
}

/*
         * @see java.text.CharacterIterator#last()
         */
public char last() {
  if (fFirst == fLast)
    return setIndex(getEndIndex());
  else
    return setIndex(getEndIndex() - 1);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#97f0b1a0]]
IDocument 
12[[#97f0b1a0]]
CharSequence 
21[[#97f0b0e0]]
fDocument 
22[[#97f0b0e0]]
fSequence 
31[[#564a99a0]]
DocumentCharacterIterator 
32[[#564a99a0]]
SequenceCharacterIterator 
41[[#97f0afe0]]
document 
42[[#97f0afe0]]
sequence 
51[[#97f0afc0]]
getLength 
52[[#97f0afc0]]
length