idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
16,700 | public void drain ( final HttpClient httpClient , final String path , final boolean gzip ) { if ( ! resendQueue . isEmpty ( ) ) { try { LOGGER . info ( "Attempting to retransmit {} requests" , resendQueue . size ( ) ) ; while ( ! resendQueue . isEmpty ( ) ) { HttpResendQueueItem item = resendQueue . peek ( ) ; try { by... | Drains the resend queue until empty or error |
16,701 | public int flush ( final LogSender sender ) throws IOException , HttpException { int numSent = 0 ; int maxToSend = queue . size ( ) ; if ( 0 < maxToSend ) { AppIdentity appIdentity = appIdentityService . getAppIdentity ( ) ; while ( numSent < maxToSend ) { int batchSize = Math . min ( maxToSend - numSent , MAX_BATCH ) ... | Flushes the queue by sending all messages to Stackify |
16,702 | private String readAndClose ( final InputStream stream ) throws IOException { String contents = null ; if ( stream != null ) { contents = CharStreams . toString ( new InputStreamReader ( new BufferedInputStream ( stream ) , "UTF-8" ) ) ; stream . close ( ) ; } return contents ; } | Reads all remaining contents from the stream and closes it |
16,703 | public static Properties loadProperties ( final String path ) { if ( path != null ) { try { File file = new File ( path ) ; if ( file . exists ( ) ) { try { Properties p = new Properties ( ) ; p . load ( new FileInputStream ( file ) ) ; return p ; } catch ( Exception e ) { log . error ( "Error loading properties from f... | Loads properties with given path - will load as file is able or classpath resource |
16,704 | public static Map < String , String > read ( final String path ) { Map < String , String > map = new HashMap < String , String > ( ) ; if ( path != null ) { try { Properties p = loadProperties ( path ) ; for ( Object key : p . keySet ( ) ) { String value = p . getProperty ( String . valueOf ( key ) ) ; if ( ( value . s... | Reads properties from file path or classpath |
16,705 | public static void sleepQuietly ( final long sleepFor , final TimeUnit unit ) { try { Thread . sleep ( unit . toMillis ( sleepFor ) ) ; } catch ( Throwable t ) { } } | Sleeps and eats any exceptions |
16,706 | public void activate ( final ApiConfiguration apiConfig ) { Preconditions . checkNotNull ( apiConfig ) ; Preconditions . checkNotNull ( apiConfig . getApiUrl ( ) ) ; Preconditions . checkArgument ( ! apiConfig . getApiUrl ( ) . isEmpty ( ) ) ; Preconditions . checkNotNull ( apiConfig . getApiKey ( ) ) ; Preconditions .... | Activates the appender |
16,707 | public void append ( final T event ) { if ( backgroundService == null ) { return ; } if ( ! backgroundService . isRunning ( ) ) { return ; } if ( ! allowComDotStackify ) { String className = eventAdapter . getClassName ( event ) ; if ( className != null ) { if ( className . startsWith ( COM_DOT_STACKIFY ) ) { return ; ... | Adds the log message to the collector |
16,708 | private String buildTemplates ( ) { String [ ] templateString = new String [ model . getTemplates ( ) . size ( ) ] ; for ( int i = 0 ; i < ( model . getTemplates ( ) . size ( ) ) ; i ++ ) { String templateLoaded = loadTemplateFile ( model . getTemplates ( ) . get ( i ) ) ; if ( templateLoaded != null ) { templateString... | Builds the path for the list of templates . |
16,709 | private String loadTemplateFile ( String templateName ) { String name = templateName . replace ( '.' , '/' ) + ".java" ; InputStream in = SpoonMojoGenerate . class . getClassLoader ( ) . getResourceAsStream ( name ) ; String packageName = templateName . substring ( 0 , templateName . lastIndexOf ( '.' ) ) ; String file... | Loads the template file at the path given . |
16,710 | private Element addRoot ( Document document , Map < ReportBuilderImpl . ReportKey , Object > reportsData ) { Element rootElement = document . createElement ( "project" ) ; if ( reportsData . containsKey ( ReportKey . PROJECT_NAME ) ) { rootElement . setAttribute ( "name" , ( String ) reportsData . get ( ReportKey . PRO... | Adds root element . |
16,711 | private Element addProcessors ( Document document , Element root , Map < ReportBuilderImpl . ReportKey , Object > reportsData ) { if ( reportsData . containsKey ( ReportKey . PROCESSORS ) ) { Element processors = document . createElement ( "processors" ) ; root . appendChild ( processors ) ; String [ ] tabProcessors = ... | Adds processors child of root element . |
16,712 | private Element addElement ( Document document , Element parent , Map < ReportKey , Object > reportsData , ReportKey key , String value ) { if ( reportsData . containsKey ( key ) ) { Element child = document . createElement ( key . name ( ) . toLowerCase ( ) ) ; child . appendChild ( document . createTextNode ( value )... | Generic method to add a element for a parent element given . |
16,713 | protected String implode ( String [ ] tabToConcatenate , String pathSeparator ) { final StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < tabToConcatenate . length ; i ++ ) { builder . append ( tabToConcatenate [ i ] ) ; if ( i < tabToConcatenate . length - 1 ) { builder . append ( pathSeparator ) ;... | Concatenates a tab in a string with a path separator given . |
16,714 | public static Uri createUri ( Class < ? extends Model > type , Long id ) { final StringBuilder uri = new StringBuilder ( ) ; uri . append ( "content://" ) ; uri . append ( sAuthority ) ; uri . append ( "/" ) ; uri . append ( Ollie . getTableName ( type ) . toLowerCase ( ) ) ; if ( id != null ) { uri . append ( "/" ) ; ... | Create a Uri for a model row . |
16,715 | public static < T extends Model > List < T > processCursor ( Class < T > cls , Cursor cursor ) { final List < T > entities = new ArrayList < T > ( ) ; try { Constructor < T > entityConstructor = cls . getConstructor ( ) ; if ( cursor . moveToFirst ( ) ) { do { T entity = getEntity ( cls , cursor . getLong ( cursor . ge... | Iterate over a cursor and load entities . |
16,716 | public static < T extends Model > List < T > processAndCloseCursor ( Class < T > cls , Cursor cursor ) { List < T > entities = processCursor ( cls , cursor ) ; cursor . close ( ) ; return entities ; } | Iterate over a cursor and load entities . Closes the cursor when finished . |
16,717 | static synchronized < T extends Model > void load ( T entity , Cursor cursor ) { sAdapterHolder . getModelAdapter ( entity . getClass ( ) ) . load ( entity , cursor ) ; } | Model adapter methods |
16,718 | public List < ClasspathResourceVersion > getResourceVersions ( ) throws URISyntaxException , IOException { if ( ! lazyLoadDone ) { if ( isClassFolder ( ) ) { logger . debug ( "\nScanning class folder: " + getUrl ( ) ) ; URI uri = new URI ( getUrl ( ) ) ; Path start = Paths . get ( uri ) ; scanClasspathEntry ( start ) ;... | The contents of a jar are only loaded if accessed the first time . |
16,719 | public CSSStyleSheetImpl merge ( ) { final CSSStyleSheetImpl merged = new CSSStyleSheetImpl ( ) ; final CSSRuleListImpl cssRuleList = new CSSRuleListImpl ( ) ; final Iterator < CSSStyleSheetImpl > it = getCSSStyleSheets ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final CSSStyleSheetImpl cssStyleSheet = it . next ... | Merges all StyleSheets in this list into one . |
16,720 | public void insertRule ( final String rule , final int index ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; parser . setParentStyleSheet ( this ) ; parser . setErrorHandler ( ThrowCssExceptionErrorHandler . INSTANCE ) ; final AbstractCSSRuleImpl r = parser . parseRule ( rule ) ; if ( r =... | inserts a new rule . |
16,721 | public void deleteRule ( final int index ) throws DOMException { try { getCssRules ( ) . delete ( index ) ; } catch ( final IndexOutOfBoundsException e ) { throw new DOMExceptionImpl ( DOMException . INDEX_SIZE_ERR , DOMExceptionImpl . INDEX_OUT_OF_BOUNDS , e . getMessage ( ) ) ; } } | delete the rule at the given pos . |
16,722 | public void setMediaText ( final String mediaText ) { try { final CSSOMParser parser = new CSSOMParser ( ) ; final MediaQueryList sml = parser . parseMedia ( mediaText ) ; media_ = new MediaListImpl ( sml ) ; } catch ( final IOException e ) { } } | Set the media text . |
16,723 | protected Locator createLocator ( final Token t ) { return new Locator ( getInputSource ( ) . getURI ( ) , t == null ? 0 : t . beginLine , t == null ? 0 : t . beginColumn ) ; } | Returns a new locator for the given token . |
16,724 | protected String addEscapes ( final String str ) { final StringBuilder sb = new StringBuilder ( ) ; char ch ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { ch = str . charAt ( i ) ; switch ( ch ) { case 0 : continue ; case '\b' : sb . append ( "\\b" ) ; continue ; case '\t' : sb . append ( "\\t" ) ; continue ; case... | Escapes some chars in the given string . |
16,725 | public MediaQueryList parseMedia ( final InputSource source ) throws IOException { source_ = source ; ReInit ( getCharStream ( source ) ) ; final MediaQueryList ml = new MediaQueryList ( ) ; try { mediaList ( ml ) ; } catch ( final ParseException e ) { getErrorHandler ( ) . error ( toCSSParseException ( "invalidMediaLi... | Parse the given input source and return the media list . |
16,726 | protected void handleImportStyle ( final String uri , final MediaQueryList media , final String defaultNamespaceURI , final Locator locator ) { getDocumentHandler ( ) . importStyle ( uri , media , defaultNamespaceURI , locator ) ; } | import style handler . |
16,727 | protected void handleStartPage ( final String name , final String pseudoPage , final Locator locator ) { getDocumentHandler ( ) . startPage ( name , pseudoPage , locator ) ; } | start page handler . |
16,728 | protected void handleProperty ( final String name , final LexicalUnit value , final boolean important , final Locator locator ) { getDocumentHandler ( ) . property ( name , value , important , locator ) ; } | property handler . |
16,729 | protected LexicalUnit functionInternal ( final LexicalUnit prev , final String funct , final LexicalUnit params ) { if ( "counter(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createCounter ( prev , params ) ; } else if ( "counters(" . equalsIgnoreCase ( funct ) ) { return LexicalUnitImpl . createCounters... | Process a function decl . |
16,730 | protected LexicalUnit hexcolorInternal ( final LexicalUnit prev , final Token t ) { final int i = 1 ; int r = 0 ; int g = 0 ; int b = 0 ; final int len = t . image . length ( ) - 1 ; try { if ( len == 3 ) { r = Integer . parseInt ( t . image . substring ( i + 0 , i + 1 ) , 16 ) ; g = Integer . parseInt ( t . image . su... | Processes a hexadecimal color definition . |
16,731 | protected int intValue ( final char op , final String s ) { final int result = Integer . parseInt ( s ) ; if ( op == '-' ) { return - 1 * result ; } return result ; } | Parses the sting into an integer . |
16,732 | protected double doubleValue ( final char op , final String s ) { final double result = Double . parseDouble ( s ) ; if ( op == '-' ) { return - 1 * result ; } return result ; } | Parses the sting into an double . |
16,733 | protected int getLastNumPos ( final String s ) { int i = 0 ; for ( ; i < s . length ( ) ; i ++ ) { if ( NUM_CHARS . indexOf ( s . charAt ( i ) ) < 0 ) { break ; } } return i - 1 ; } | Returns the pos of the last numeric char in the given string . |
16,734 | public static void sortByNumberOfVersionsDesc ( List < ClasspathResource > resources ) { Comparator < ClasspathResource > sortByNumberOfVersionsDesc = new Comparator < ClasspathResource > ( ) { public int compare ( ClasspathResource resource1 , ClasspathResource resource2 ) { return - 1 * new Integer ( resource1 . getR... | Takes a list of classpath resources and sorts them by the number of classpath versions . |
16,735 | public static List < ClasspathResource > findResourcesWithDuplicates ( List < ClasspathResource > resourceFiles , boolean excludeSameSizeDups ) { List < ClasspathResource > resourcesWithDuplicates = new ArrayList < > ( ) ; for ( ClasspathResource resource : resourceFiles ) { if ( resource . hasDuplicates ( excludeSameS... | Inspects a given list of classpath resources and returns only the resources that contain multiple versions . |
16,736 | public void setMediaText ( final String mediaText ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; parser . setErrorHandler ( ThrowCssExceptionErrorHandler . INSTANCE ) ; final MediaQueryList sml = parser . parseMedia ( mediaText ) ; setMediaList ( sml ) ; } catch ( final CSSParseException... | Parses the given media text . |
16,737 | public void setMedia ( final List < String > media ) { mediaQueries_ . clear ( ) ; for ( String medium : media ) { mediaQueries_ . add ( new MediaQuery ( medium ) ) ; } } | Resets the list of media queries . |
16,738 | public CSSStyleSheetImpl parseStyleSheet ( final InputSource source , final String href ) throws IOException { final CSSOMHandler handler = new CSSOMHandler ( ) ; handler . setHref ( href ) ; parser_ . setDocumentHandler ( handler ) ; parser_ . parseStyleSheet ( source ) ; final Object o = handler . getRoot ( ) ; if ( ... | Parses a SAC input source into a CSSOM style sheet . |
16,739 | public CSSValueImpl parsePropertyValue ( final String propertyValue ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( propertyValue ) ) ) { final CSSOMHandler handler = new CSSOMHandler ( ) ; parser_ . setDocumentHandler ( handler ) ; final LexicalUnit lu = parser_ . parsePropertyVa... | Parses a input string into a CSSValue . |
16,740 | public AbstractCSSRuleImpl parseRule ( final String rule ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( rule ) ) ) { final CSSOMHandler handler = new CSSOMHandler ( ) ; parser_ . setDocumentHandler ( handler ) ; parser_ . parseRule ( source ) ; return ( AbstractCSSRuleImpl ) hand... | Parses a string into a CSSRule . |
16,741 | public SelectorList parseSelectors ( final String selectors ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( selectors ) ) ) { final HandlerBase handler = new HandlerBase ( ) ; parser_ . setDocumentHandler ( handler ) ; return parser_ . parseSelectors ( source ) ; } } | Parses a string into a CSSSelectorList . |
16,742 | public MediaQueryList parseMedia ( final String media ) throws IOException { try ( InputSource source = new InputSource ( new StringReader ( media ) ) ) { final HandlerBase handler = new HandlerBase ( ) ; parser_ . setDocumentHandler ( handler ) ; if ( parser_ instanceof AbstractCSSParser ) { return ( ( AbstractCSSPars... | Parses a string into a MediaQueryList . |
16,743 | public String removeProperty ( final String propertyName ) throws DOMException { if ( null == propertyName ) { return "" ; } for ( int i = 0 ; i < properties_ . size ( ) ; i ++ ) { final Property p = properties_ . get ( i ) ; if ( p != null && propertyName . equalsIgnoreCase ( p . getName ( ) ) ) { properties_ . remove... | Remove a property . |
16,744 | public void insertRule ( final String rule , final int index ) throws DOMException { final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet ( ) ; try { final CSSOMParser parser = new CSSOMParser ( ) ; parser . setParentStyleSheet ( parentStyleSheet ) ; parser . setErrorHandler ( ThrowCssExceptionErrorHandler . ... | Insert a new rule at the given index . |
16,745 | public static String trimBy ( final StringBuilder s , final int left , final int right ) { return s . substring ( left , s . length ( ) - right ) ; } | Remove the given number of chars from start and end . There is no parameter checking the caller has to take care of this . |
16,746 | public String getMessage ( ) { if ( message_ != null ) { return message_ ; } if ( getCause ( ) != null ) { return getCause ( ) . getMessage ( ) ; } switch ( code_ ) { case UNSPECIFIED_ERR : return "unknown error" ; case NOT_SUPPORTED_ERR : return "not supported" ; case SYNTAX_ERR : return "syntax error" ; default : ret... | Returns the detail message of this throwable object . |
16,747 | public void addCondition ( final Condition condition ) { if ( conditions_ == null ) { conditions_ = new ArrayList < > ( ) ; } conditions_ . add ( condition ) ; } | Add a condition . |
16,748 | public void setSelectorText ( final String selectorText ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; selectors_ = parser . parseSelectors ( selectorText ) ; } catch ( final CSSException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e .... | Sets the selector text . |
16,749 | public static void setDebugAll ( final boolean bDebug ) { setDebugText ( bDebug ) ; setDebugFont ( bDebug ) ; setDebugSplit ( bDebug ) ; setDebugPrepare ( bDebug ) ; setDebugRender ( bDebug ) ; } | Shortcut to globally en - or disable debugging |
16,750 | public Version withPreRelease ( String newPreRelease ) { require ( newPreRelease != null , "newPreRelease is null" ) ; final String [ ] newPreReleaseParts = parsePreRelease ( newPreRelease ) ; return new Version ( this . major , this . minor , this . patch , newPreReleaseParts , this . buildMetaDataParts ) ; } | Creates a new Version from this one replacing only the pre - release part with the given String . All other parts will remain the same as in this Version . You can remove the pre - release part by passing an empty String . |
16,751 | public Version withBuildMetaData ( String newBuildMetaData ) { require ( newBuildMetaData != null , "newBuildMetaData is null" ) ; final String [ ] newBuildMdParts = parseBuildMd ( newBuildMetaData ) ; return new Version ( this . major , this . minor , this . patch , this . preReleaseParts , newBuildMdParts ) ; } | Creates a new Version from this one replacing only the build - meta - data part with the given String . All other parts will remain the same as in this Version . You can remove the build - meta - data part by passing an empty String . |
16,752 | public Version nextPreRelease ( ) { final String [ ] newPreReleaseParts = incrementIdentifier ( this . preReleaseParts ) ; return new Version ( this . major , this . minor , this . patch , newPreReleaseParts , EMPTY_ARRAY ) ; } | Derives a new Version instance from this one by only incrementing the pre - release identifier . The build - meta - data will be dropped all other fields remain the same . |
16,753 | public Version nextBuildMetaData ( ) { final String [ ] newBuildMetaData = incrementIdentifier ( this . buildMetaDataParts ) ; return new Version ( this . major , this . minor , this . patch , this . preReleaseParts , newBuildMetaData ) ; } | Derives a new Version instance from this one by only incrementing the build - meta - data identifier . All other fields remain the same . |
16,754 | private static int isNumeric ( String s ) { final char [ ] chars = s . toCharArray ( ) ; int num = 0 ; for ( int i = 0 ; i < chars . length ; ++ i ) { final char c = chars [ i ] ; if ( c >= '0' && c <= '9' ) { num = num * DECIMAL + Character . digit ( c , DECIMAL ) ; } else { return - 1 ; } } return num ; } | Determines whether s is a positive number . If it is the number is returned otherwise the result is - 1 . |
16,755 | public String [ ] getPreReleaseParts ( ) { if ( this . preReleaseParts . length == 0 ) { return EMPTY_ARRAY ; } return Arrays . copyOf ( this . preReleaseParts , this . preReleaseParts . length ) ; } | Gets the pre release identifier parts of this version as array . Modifying the resulting array will have no influence on the internal state of this object . |
16,756 | public String [ ] getBuildMetaDataParts ( ) { if ( this . buildMetaDataParts . length == 0 ) { return EMPTY_ARRAY ; } return Arrays . copyOf ( this . buildMetaDataParts , this . buildMetaDataParts . length ) ; } | Gets the build meta data identifier parts of this version as array . Modifying the resulting array will have no influence on the internal state of this object . |
16,757 | public Version toUpperCase ( ) { return new Version ( this . major , this . minor , this . patch , copyCase ( this . preReleaseParts , true ) , copyCase ( this . buildMetaDataParts , true ) ) ; } | Returns a new Version where all identifiers are converted to upper case letters . |
16,758 | public Version toLowerCase ( ) { return new Version ( this . major , this . minor , this . patch , copyCase ( this . preReleaseParts , false ) , copyCase ( this . buildMetaDataParts , false ) ) ; } | Returns a new Version where all identifiers are converted to lower case letters . |
16,759 | private Object readResolve ( ) throws ObjectStreamException { if ( this . preRelease != null || this . buildMetaData != null ) { return createInternal ( this . major , this . minor , this . patch , this . preRelease , this . buildMetaData ) ; } return this ; } | Handles proper deserialization of objects serialized with a version prior to 1 . 1 . 0 |
16,760 | public static void avoidDoubleBorders ( final PLTable ret ) { boolean bPreviousRowHasBottomBorder = false ; for ( int i = 0 ; i < ret . getRowCount ( ) ; i ++ ) { boolean bRowHasBottomBorder = true ; boolean bRowHasTopBorder = true ; final PLTableRow aRow = ret . getRowAtIndex ( i ) ; for ( int j = 0 ; j < aRow . getCo... | If two joined rows both have borders at their connecting side the doubles width has to be removed |
16,761 | public FontSpec getCloneWithDifferentFont ( final PreloadFont aNewFont ) { ValueEnforcer . notNull ( aNewFont , "NewFont" ) ; if ( aNewFont . equals ( m_aPreloadFont ) ) return this ; return new FontSpec ( aNewFont , m_fFontSize , m_aColor ) ; } | Return a clone of this object but with a different font . |
16,762 | public FontSpec getCloneWithDifferentFontSize ( final float fNewFontSize ) { ValueEnforcer . isGT0 ( fNewFontSize , "FontSize" ) ; if ( EqualsHelper . equals ( fNewFontSize , m_fFontSize ) ) return this ; return new FontSpec ( m_aPreloadFont , fNewFontSize , m_aColor ) ; } | Return a clone of this object but with a different font size . |
16,763 | public FontSpec getCloneWithDifferentColor ( final Color aNewColor ) { ValueEnforcer . notNull ( aNewColor , "NewColor" ) ; if ( aNewColor . equals ( m_aColor ) ) return this ; return new FontSpec ( m_aPreloadFont , m_fFontSize , aNewColor ) ; } | Return a clone of this object but with a different color . |
16,764 | public float getEffectiveValue ( final float fAvailableHeight ) { switch ( m_eType ) { case ABSOLUTE : return Math . min ( m_fValue , fAvailableHeight ) ; case PERCENTAGE : return fAvailableHeight * m_fValue / 100 ; default : throw new IllegalStateException ( "Unsupported: " + m_eType + " - must be calculated outside!"... | Get the effective height based on the passed available height . This may not be called for star or auto height elements . |
16,765 | public static HeightSpec abs ( final float fValue ) { ValueEnforcer . isGT0 ( fValue , "Value" ) ; return new HeightSpec ( EValueUOMType . ABSOLUTE , fValue ) ; } | Create a height element with an absolute value . |
16,766 | public static HeightSpec perc ( final float fPerc ) { ValueEnforcer . isGT0 ( fPerc , "Perc" ) ; return new HeightSpec ( EValueUOMType . PERCENTAGE , fPerc ) ; } | Create a height element with an percentage value . |
16,767 | public static PLTable createWithPercentage ( final float ... aPercentages ) { ValueEnforcer . notEmpty ( aPercentages , "Percentages" ) ; final ICommonsList < WidthSpec > aWidths = new CommonsArrayList < > ( aPercentages . length ) ; for ( final float fPercentage : aPercentages ) aWidths . add ( WidthSpec . perc ( fPer... | Create a new table with the specified percentages . |
16,768 | public static PLTable createWithEvenlySizedColumns ( final int nColumnCount ) { ValueEnforcer . isGT0 ( nColumnCount , "ColumnCount" ) ; final ICommonsList < WidthSpec > aWidths = new CommonsArrayList < > ( nColumnCount ) ; for ( int i = 0 ; i < nColumnCount ; ++ i ) aWidths . add ( WidthSpec . star ( ) ) ; return new ... | Create a new table with evenly sized columns . |
16,769 | private void _setPreparedSize ( final SizeSpec aPreparedSize ) { ValueEnforcer . notNull ( aPreparedSize , "PreparedSize" ) ; m_bPrepared = true ; m_aPreparedSize = aPreparedSize ; m_aRenderSize = getRenderSize ( aPreparedSize ) ; if ( PLDebugLog . isDebugPrepare ( ) ) { String sSuffix = "" ; if ( this instanceof IPLHa... | Set the prepared size of this object . This method also handles min and max size |
16,770 | protected final IMPLTYPE internalMarkAsPrepared ( final SizeSpec aPreparedSize ) { internalCheckNotPrepared ( ) ; _setPreparedSize ( aPreparedSize ) ; return thisAsT ( ) ; } | INTERNAL method . Do not call from outside! |
16,771 | public void setFont ( final PDFont font , final float fontSize ) throws IOException { if ( fontStack . isEmpty ( ) ) fontStack . add ( font ) ; else fontStack . set ( fontStack . size ( ) - 1 , font ) ; PDDocumentHelper . handleFontSubset ( m_aDoc , font ) ; writeOperand ( resources . add ( font ) ) ; writeOperand ( fo... | Set the font and font size to draw text with . |
16,772 | public void showText ( final String text ) throws IOException { if ( ! inTextMode ) { throw new IllegalStateException ( "Must call beginText() before showText()" ) ; } if ( fontStack . isEmpty ( ) ) { throw new IllegalStateException ( "Must call setFont() before showText()" ) ; } final PDFont font = fontStack . peek ( ... | Shows the given text at the location specified by the current text matrix . |
16,773 | public void setTextMatrix ( final Matrix matrix ) throws IOException { if ( ! inTextMode ) { throw new IllegalStateException ( "Error: must call beginText() before setTextMatrix" ) ; } writeAffineTransform ( matrix . createAffineTransform ( ) ) ; writeOperator ( ( byte ) 'T' , ( byte ) 'm' ) ; } | The Tm operator . Sets the text matrix to the given values . A current text matrix will be replaced with the new one . |
16,774 | public void drawImage ( final PDImageXObject image , final float x , final float y ) throws IOException { drawImage ( image , x , y , image . getWidth ( ) , image . getHeight ( ) ) ; } | Draw an image at the x y coordinates with the default size of the image . |
16,775 | public void drawImage ( final PDImageXObject image , final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawImage is not allowed within a text block." ) ; } saveGraphicsState ( ) ; final AffineTransform transform = ... | Draw an image at the x y coordinates with the given size . |
16,776 | public void drawImage ( final PDInlineImage inlineImage , final float x , final float y ) throws IOException { drawImage ( inlineImage , x , y , inlineImage . getWidth ( ) , inlineImage . getHeight ( ) ) ; } | Draw an inline image at the x y coordinates with the default size of the image . |
16,777 | public void drawImage ( final PDInlineImage inlineImage , final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawImage is not allowed within a text block." ) ; } saveGraphicsState ( ) ; transform ( new Matrix ( widt... | Draw an inline image at the x y coordinates and a certain width and height . |
16,778 | public void drawForm ( final PDFormXObject form ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: drawForm is not allowed within a text block." ) ; } writeOperand ( resources . add ( form ) ) ; writeOperator ( ( byte ) 'D' , ( byte ) 'o' ) ; } | Draws the given Form XObject at the current location . |
16,779 | public void saveGraphicsState ( ) throws IOException { if ( ! fontStack . isEmpty ( ) ) { fontStack . push ( fontStack . peek ( ) ) ; } if ( ! strokingColorSpaceStack . isEmpty ( ) ) { strokingColorSpaceStack . push ( strokingColorSpaceStack . peek ( ) ) ; } if ( ! nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStroki... | q operator . Saves the current graphics state . |
16,780 | public void restoreGraphicsState ( ) throws IOException { if ( ! fontStack . isEmpty ( ) ) { fontStack . pop ( ) ; } if ( ! strokingColorSpaceStack . isEmpty ( ) ) { strokingColorSpaceStack . pop ( ) ; } if ( ! nonStrokingColorSpaceStack . isEmpty ( ) ) { nonStrokingColorSpaceStack . pop ( ) ; } writeOperator ( ( byte ... | Q operator . Restores the current graphics state . |
16,781 | public void setStrokingColor ( final double g ) throws IOException { if ( _isOutsideOneInterval ( g ) ) { throw new IllegalArgumentException ( "Parameter must be within 0..1, but is " + g ) ; } writeOperand ( ( float ) g ) ; writeOperator ( ( byte ) 'G' ) ; } | Set the stroking color in the DeviceGray color space . Range is 0 .. 1 . |
16,782 | public void setNonStrokingColor ( final PDColor color ) throws IOException { if ( nonStrokingColorSpaceStack . isEmpty ( ) || nonStrokingColorSpaceStack . peek ( ) != color . getColorSpace ( ) ) { writeOperand ( getName ( color . getColorSpace ( ) ) ) ; writeOperator ( ( byte ) 'c' , ( byte ) 's' ) ; if ( nonStrokingCo... | Sets the non - stroking color and if necessary the non - stroking color space . |
16,783 | public void setNonStrokingColor ( final Color color ) throws IOException { final float [ ] components = new float [ ] { color . getRed ( ) / 255f , color . getGreen ( ) / 255f , color . getBlue ( ) / 255f } ; final PDColor pdColor = new PDColor ( components , PDDeviceRGB . INSTANCE ) ; setNonStrokingColor ( pdColor ) ;... | Set the non - stroking color using an AWT color . Conversion uses the default sRGB color space . |
16,784 | public void setNonStrokingColor ( final int r , final int g , final int b ) throws IOException { if ( _isOutside255Interval ( r ) || _isOutside255Interval ( g ) || _isOutside255Interval ( b ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..255, but are (" + r + "," + g + "," + b + ")" ) ; } write... | Set the non - stroking color in the DeviceRGB color space . Range is 0 .. 255 . |
16,785 | public void setNonStrokingColor ( final int c , final int m , final int y , final int k ) throws IOException { if ( _isOutside255Interval ( c ) || _isOutside255Interval ( m ) || _isOutside255Interval ( y ) || _isOutside255Interval ( k ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..255, but are... | Set the non - stroking color in the DeviceCMYK color space . Range is 0 .. 255 . |
16,786 | public void setNonStrokingColor ( final double c , final double m , final double y , final double k ) throws IOException { if ( _isOutsideOneInterval ( c ) || _isOutsideOneInterval ( m ) || _isOutsideOneInterval ( y ) || _isOutsideOneInterval ( k ) ) { throw new IllegalArgumentException ( "Parameters must be within 0..... | Set the non - stroking color in the DeviceRGB color space . Range is 0 .. 1 . |
16,787 | public void setNonStrokingColor ( final double g ) throws IOException { if ( _isOutsideOneInterval ( g ) ) { throw new IllegalArgumentException ( "Parameter must be within 0..1, but is " + g ) ; } writeOperand ( ( float ) g ) ; writeOperator ( ( byte ) 'g' ) ; } | Set the non - stroking color in the DeviceGray color space . Range is 0 .. 1 . |
16,788 | public void addRect ( final float x , final float y , final float width , final float height ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: addRect is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperand ( width ) ; writeOperand ( height ) ... | Add a rectangle to the current path . |
16,789 | public void moveTo ( final float x , final float y ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: moveTo is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperator ( ( byte ) 'm' ) ; } | Move the current position to the given coordinates . |
16,790 | public void lineTo ( final float x , final float y ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: lineTo is not allowed within a text block." ) ; } writeOperand ( x ) ; writeOperand ( y ) ; writeOperator ( ( byte ) 'l' ) ; } | Draw a line from the current position to the given coordinates . |
16,791 | public void shadingFill ( final PDShading shading ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: shadingFill is not allowed within a text block." ) ; } writeOperand ( resources . add ( shading ) ) ; writeOperator ( ( byte ) 's' , ( byte ) 'h' ) ; } | Fills the clipping area with the given shading . |
16,792 | public void setLineJoinStyle ( final int lineJoinStyle ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineJoinStyle is not allowed within a text block." ) ; } if ( lineJoinStyle >= 0 && lineJoinStyle <= 2 ) { writeOperand ( lineJoinStyle ) ; writeOperator ( ( byte ) 'j' ) ; } el... | Set the line join style . |
16,793 | public void setLineCapStyle ( final int lineCapStyle ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineCapStyle is not allowed within a text block." ) ; } if ( lineCapStyle >= 0 && lineCapStyle <= 2 ) { writeOperand ( lineCapStyle ) ; writeOperator ( ( byte ) 'J' ) ; } else { t... | Set the line cap style . |
16,794 | public void setLineDashPattern ( final float [ ] pattern , final float phase ) throws IOException { if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineDashPattern is not allowed within a text block." ) ; } write ( ( byte ) '[' ) ; for ( final float value : pattern ) { writeOperand ( value ) ; } write ... | Set the line dash pattern . |
16,795 | public void beginMarkedContent ( final COSName tag , final PDPropertyList propertyList ) throws IOException { writeOperand ( tag ) ; writeOperand ( resources . add ( propertyList ) ) ; writeOperator ( ( byte ) 'B' , ( byte ) 'D' , ( byte ) 'C' ) ; } | Begin a marked content sequence with a reference to an entry in the page resources Properties dictionary . |
16,796 | protected void writeOperand ( final float real ) throws IOException { final int byteCount = NumberFormatUtil . formatFloatFast ( real , formatDecimal . getMaximumFractionDigits ( ) , formatBuffer ) ; if ( byteCount == - 1 ) { write ( formatDecimal . format ( real ) ) ; } else { m_aOS . write ( formatBuffer , 0 , byteCo... | Writes a real real to the content stream . |
16,797 | private void writeAffineTransform ( final AffineTransform transform ) throws IOException { final double [ ] values = new double [ 6 ] ; transform . getMatrix ( values ) ; for ( final double v : values ) { writeOperand ( ( float ) v ) ; } } | Writes an AffineTransform to the content stream as an array . |
16,798 | public void addPageSet ( final PLPageSet aPageSet ) { ValueEnforcer . notNull ( aPageSet , "PageSet" ) ; m_aPageSets . add ( aPageSet ) ; } | Add a new page set |
16,799 | void setHeaderHeight ( final float fHeaderHeight ) { if ( Float . isNaN ( m_fHeaderHeight ) ) m_fHeaderHeight = fHeaderHeight ; else m_fHeaderHeight = Math . max ( m_fHeaderHeight , fHeaderHeight ) ; } | Set the page header height . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.