1 package com.icl.saxon; 2 import com.icl.saxon.om.*; 3 import com.icl.saxon.handlers.*; 4 import com.icl.saxon.expr.*; 5 import com.icl.saxon.output.*; 6 7 import org.xml.sax.*; 8 import java.util.*; 9 10 11 15 16 public class PreviewManager { 17 18 private int previewModeNameCode = -1; 19 private int[] previewElements = new int[10]; 20 private int used = 0; 21 23 27 31 37 38 public void setPreviewMode(int mode) { 39 previewModeNameCode = mode; 40 } 41 42 public final int getPreviewMode() { 43 return previewModeNameCode; 44 } 45 46 51 52 public void setPreviewElement(int fingerprint) { 53 if (used>=previewElements.length) { 54 int[] n = new int[used*2]; 55 System.arraycopy(previewElements, 0, n, 0, used); 56 previewElements = n; 57 } 58 previewElements[used++] = fingerprint; 59 } 60 61 64 65 public boolean isPreviewElement(int fingerprint) { 66 for (int i=0; i<used; i++) { 67 if (fingerprint == previewElements[i]) return true; 68 } 69 return false; 70 } 71 72 73 } 74 75 | Popular Tags |