comparison dwtx/jface/text/rules/FastPartitioner.d @ 160:3678e4f1a766

toHash, toString
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 02:07:22 +0200
parents f70d9508c95c
children 1a5b8f8129df
comparison
equal deleted inserted replaced
159:7926b636c282 160:3678e4f1a766
134 * @param legalContentTypes the legal content types of this partitioner 134 * @param legalContentTypes the legal content types of this partitioner
135 */ 135 */
136 public this(IPartitionTokenScanner scanner, String[] legalContentTypes) { 136 public this(IPartitionTokenScanner scanner, String[] legalContentTypes) {
137 fScanner= scanner; 137 fScanner= scanner;
138 fLegalContentTypes= TextUtilities.copy(legalContentTypes); 138 fLegalContentTypes= TextUtilities.copy(legalContentTypes);
139 fPositionCategory= CONTENT_TYPES_CATEGORY + hashCode(); 139 fPositionCategory= CONTENT_TYPES_CATEGORY + toHash();
140 fPositionUpdater= new DefaultPositionUpdater(fPositionCategory); 140 fPositionUpdater= new DefaultPositionUpdater(fPositionCategory);
141 } 141 }
142 142
143 /* 143 /*
144 * @see dwtx.jface.text.IDocumentPartitionerExtension2#getManagingPositionCategories() 144 * @see dwtx.jface.text.IDocumentPartitionerExtension2#getManagingPositionCategories()
843 * Pretty print a <code>Position</code>. 843 * Pretty print a <code>Position</code>.
844 * 844 *
845 * @param position the position to format 845 * @param position the position to format
846 * @return a formatted string 846 * @return a formatted string
847 */ 847 */
848 private String toString(Position position) { 848 private override String toString(Position position) {
849 return "P[" + position.getOffset() + "+" + position.getLength() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 849 return "P[" + position.getOffset() + "+" + position.getLength() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
850 } 850 }
851 } 851 }