idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
11,000
private void getTCerts ( ) { GetTCertBatchRequest req = new GetTCertBatchRequest ( this . member . getName ( ) , this . member . getEnrollment ( ) , this . member . getTCertBatchSize ( ) , attrs ) ; try { List < TCert > tcerts = this . memberServices . getTCertBatch ( req ) ; for ( TCert tcert : tcerts ) { this . tcert...
Call member services to get more tcerts
11,001
static public void main ( String [ ] args ) { String propertyValue = args [ 0 ] ; logger . info ( "Property Value: " + propertyValue ) ; String encryptedValue = encryptor . encryptPropertyValue ( propertyValue ) ; logger . info ( "Encrypted Value: " + encryptedValue ) ; }
The main method for this application .
11,002
public static Builder getNodeConfig ( String clusterName , String nodeName , String networkHost , String homePath , boolean nodeIngest ) { return Settings . builder ( ) . put ( "node.name" , nodeName ) . put ( "cluster.name" , clusterName ) . put ( "network.host" , networkHost ) . put ( "path.home" , homePath ) . put (...
Gets node config .
11,003
protected void init ( ) { JButton testButton = new JButton ( ) ; oldDayBackgroundColor = testButton . getBackground ( ) ; selectedColor = new Color ( 160 , 160 , 160 ) ; Date date = calendar . getTime ( ) ; calendar = Calendar . getInstance ( locale ) ; calendar . setTime ( date ) ; drawDayNames ( ) ; drawDays ( ) ; }
Initilizes the locale specific names for the days of the week .
11,004
private void drawDayNames ( ) { int firstDayOfWeek = calendar . getFirstDayOfWeek ( ) ; DateFormatSymbols dateFormatSymbols = new DateFormatSymbols ( locale ) ; dayNames = dateFormatSymbols . getShortWeekdays ( ) ; int day = firstDayOfWeek ; for ( int i = 0 ; i < 7 ; i ++ ) { if ( maxDayCharacters > 0 && maxDayCharacte...
Draws the day names of the day columnes .
11,005
protected void initDecorations ( ) { for ( int x = 0 ; x < 7 ; x ++ ) { days [ x ] . setContentAreaFilled ( decorationBackgroundVisible ) ; days [ x ] . setBorderPainted ( decorationBordersVisible ) ; days [ x ] . invalidate ( ) ; days [ x ] . repaint ( ) ; weeks [ x ] . setContentAreaFilled ( decorationBackgroundVisib...
Initializes both day names and weeks of the year .
11,006
protected void drawWeeks ( ) { Calendar tmpCalendar = ( Calendar ) calendar . clone ( ) ; for ( int i = 1 ; i < 7 ; i ++ ) { tmpCalendar . set ( Calendar . DAY_OF_MONTH , ( i * 7 ) - 6 ) ; int week = tmpCalendar . get ( Calendar . WEEK_OF_YEAR ) ; String buttonText = Integer . toString ( week ) ; if ( week < 10 ) { but...
Hides and shows the week buttons .
11,007
public void setDay ( int d ) { if ( d < 1 ) { d = 1 ; } Calendar tmpCalendar = ( Calendar ) calendar . clone ( ) ; tmpCalendar . set ( Calendar . DAY_OF_MONTH , 1 ) ; tmpCalendar . add ( Calendar . MONTH , 1 ) ; tmpCalendar . add ( Calendar . DATE , - 1 ) ; int maxDaysInMonth = tmpCalendar . get ( Calendar . DATE ) ; i...
Sets the day . This is a bound property .
11,008
public void setMonth ( int month ) { calendar . set ( Calendar . MONTH , month ) ; int maxDays = calendar . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; int adjustedDay = day ; if ( day > maxDays ) { adjustedDay = maxDays ; setDay ( adjustedDay ) ; } drawDays ( ) ; }
Sets a specific month . This is needed for correct graphical representation of the days .
11,009
public void setForeground ( Color foreground ) { super . setForeground ( foreground ) ; if ( days != null ) { for ( int i = 7 ; i < 49 ; i ++ ) { days [ i ] . setForeground ( foreground ) ; } drawDays ( ) ; } }
Sets the foregroundColor color .
11,010
public void actionPerformed ( ActionEvent e ) { JButton button = ( JButton ) e . getSource ( ) ; String buttonText = button . getText ( ) ; int day = new Integer ( buttonText ) . intValue ( ) ; setDay ( day ) ; }
JDayChooser is the ActionListener for all day buttons .
11,011
public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; for ( short i = 0 ; i < days . length ; i ++ ) { if ( days [ i ] != null ) { days [ i ] . setEnabled ( enabled ) ; } } for ( short i = 0 ; i < weeks . length ; i ++ ) { if ( weeks [ i ] != null ) { weeks [ i ] . setEnabled ( enabled ) ; } } }
Enable or disable the JDayChooser .
11,012
public void setWeekOfYearVisible ( boolean weekOfYearVisible ) { if ( weekOfYearVisible == this . weekOfYearVisible ) { return ; } else if ( weekOfYearVisible ) { add ( weekPanel , BorderLayout . WEST ) ; } else { remove ( weekPanel ) ; } this . weekOfYearVisible = weekOfYearVisible ; validate ( ) ; dayPanel . validate...
In some Countries it is often usefull to know in which week of the year a date is .
11,013
public void setDecorationBackgroundColor ( Color decorationBackgroundColor ) { this . decorationBackgroundColor = decorationBackgroundColor ; if ( days != null ) { for ( int i = 0 ; i < 7 ; i ++ ) { days [ i ] . setBackground ( decorationBackgroundColor ) ; } } if ( weeks != null ) { for ( int i = 0 ; i < 7 ; i ++ ) { ...
Sets the background of days and weeks of year buttons .
11,014
public void updateUI ( ) { super . updateUI ( ) ; setFont ( Font . decode ( "Dialog Plain 11" ) ) ; if ( weekPanel != null ) { weekPanel . updateUI ( ) ; } if ( initialized ) { if ( "Windows" . equals ( UIManager . getLookAndFeel ( ) . getID ( ) ) ) { setDayBordersVisible ( false ) ; setDecorationBackgroundVisible ( tr...
Updates the UI and sets the day button preferences .
11,015
public void close ( ) throws IOException { synchronized ( lock ) { decoder = null ; if ( in != null ) { in . close ( ) ; in = null ; } } }
Closes this reader . This implementation closes the source InputStream and releases all local storage .
11,016
public int read ( ) throws IOException { synchronized ( lock ) { if ( ! isOpen ( ) ) { throw new IOException ( "InputStreamReader is closed." ) ; } char buf [ ] = new char [ 1 ] ; return read ( buf , 0 , 1 ) != - 1 ? buf [ 0 ] : - 1 ; } }
Reads a single character from this reader and returns it as an integer with the two higher - order bytes set to 0 . Returns - 1 if the end of the reader has been reached . The byte value is either obtained from converting bytes in this reader s buffer or by first filling the buffer from the source InputStream and then ...
11,017
public boolean dependsOn ( DependencyNode dependency ) { boolean dependsDirectly = dependenciesVia . contains ( dependency ) ; if ( dependsDirectly ) return true ; for ( DependencyNode reqDependency : dependency . dependantsVia ) { if ( dependsOn ( reqDependency ) ) return true ; } return false ; }
Directly or indirectly
11,018
public static String tryToTrimToSize ( String s , int length , boolean trimSuffix ) { if ( s == null || s . isEmpty ( ) ) { return s ; } else if ( s . length ( ) <= length ) { return s ; } else if ( s . contains ( File . separator ) ) { String before = s . substring ( 0 , s . lastIndexOf ( File . separator ) ) ; String...
Try to trim a String to the given size .
11,019
public int getShowYear ( ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( getDate ( ) ) ; return cal . get ( Calendar . YEAR ) ; }
Get year val from text field
11,020
public int getShowMonth ( ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( getDate ( ) ) ; return cal . get ( Calendar . MONDAY ) ; }
Get month val from text field
11,021
void selectDay ( int year , int month , int day ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( year , month , day ) ; Date date = cal . getTime ( ) ; this . field . setText ( simpleDateFormat . format ( date ) ) ; if ( popup != null ) { popup . hide ( ) ; popup = null ; } }
Set date to text field
11,022
public static void datePicker ( JTextField field , String format , DateFilter filter ) { new DatePicker ( field , format , filter ) ; }
Add a date picker to a text field with date format
11,023
public static void dateTimePicker ( JTextField field , String format , DateFilter filter ) { new DateTimePicker ( field , format , filter ) ; }
Add a time picker to a text field with time format
11,024
public int fillWindow ( ByteBuffer buffer ) { assert ! finishing ; if ( readPos >= bufSize - keepSizeAfter ) moveWindow ( ) ; int len = buffer . remaining ( ) ; if ( len > bufSize - writePos ) len = bufSize - writePos ; buffer . get ( buf , writePos , len ) ; writePos += len ; if ( writePos >= keepSizeAfter ) readLimit...
Copies new data into the LZEncoder s buffer .
11,025
private void handlePhotoPrivacySelection ( int photoPrivacyIndex , String albumName , String albumGraphPath ) { FacebookSettingsActivity activity = ( FacebookSettingsActivity ) getActivity ( ) ; if ( activity != null && ! activity . isFinishing ( ) ) { String [ ] privacyArray = getResources ( ) . getStringArray ( R . a...
Handles the photo privacy selection .
11,026
private < T , R > void applyPredicates ( JoinerQuery < T , R > request , JPAQuery query , Set < Path < ? > > usedAliases , List < JoinDescription > joins ) { if ( request . getWhere ( ) != null ) { Predicate where = predicateAliasResolver . resolvePredicate ( request . getWhere ( ) , joins , usedAliases ) ; checkAliase...
Apply where groupBy and having
11,027
public AffineTransform metersToTilePixelsTransform ( int tx , int ty , int zoomLevel ) { AffineTransform result = new AffineTransform ( ) ; double scale = 1.0 / resolution ( zoomLevel ) ; int nTiles = 2 << ( zoomLevel - 1 ) ; int px = tx * - 256 ; int py = ( nTiles - ty ) * - 256 ; result . scale ( 1 , - 1 ) ; result ....
Create a transform that converts meters to tile - relative pixels
11,028
public Coordinate metersToTile ( Coordinate coord , int zoomLevel ) { Coordinate pixels = metersToPixels ( coord . x , coord . y , zoomLevel ) ; int tx = ( int ) pixels . x / 256 ; int ty = ( int ) pixels . y / 256 ; return new Coordinate ( tx , ty , zoomLevel ) ; }
Returns the tile coordinate of the meters coordinate
11,029
public Coordinate tileTopLeft ( int tx , int ty , int zoomLevel ) { int px = tx * tileSize ; int py = ty * tileSize ; Coordinate result = pixelsToMeters ( px , py , zoomLevel ) ; return result ; }
Returns the top - left corner of the specific tile coordinate
11,030
public static Timestamp getTimeStamp ( String time ) { if ( time . equalsIgnoreCase ( "now" ) ) { return Timestamp . now ( ) ; } else { int quantity = 0 ; String unit = "" ; Pattern lastNUnitsPattern = Pattern . compile ( "last\\s*(\\d*)\\s*(min|mins|hour|hours|day|days|week|weeks).*" , Pattern . CASE_INSENSITIVE ) ; M...
A Helper function to help you convert various string represented time definition to an absolute Timestamp .
11,031
public void write ( byte [ ] bytes ) throws IOException { for ( int i = 0 ; i < bytes . length ; i ++ ) { write ( bytes [ i ] ) ; } }
Writes the given bytes to the destination
11,032
public void write ( byte myByte ) throws IOException { onNewLine = false ; buffer . put ( myByte ) ; if ( ! buffer . hasRemaining ( ) ) { flush ( ) ; } }
Writes the single byte to the destination
11,033
public Collection < PrimaryWorkitem > getCompletedPrimaryWorkitems ( PrimaryWorkitemFilter filter ) { filter = ( filter != null ) ? filter : new PrimaryWorkitemFilter ( ) ; filter . completedIn . clear ( ) ; filter . completedIn . add ( this ) ; return getInstance ( ) . get ( ) . primaryWorkitems ( filter ) ; }
Stories and Defects completed in this Build Run .
11,034
public Collection < Defect > getFoundDefects ( DefectFilter filter ) { filter = ( filter != null ) ? filter : new DefectFilter ( ) ; filter . foundIn . clear ( ) ; filter . foundIn . add ( this ) ; return getInstance ( ) . get ( ) . defects ( filter ) ; }
Defects found in this Build Run .
11,035
public final void execute ( ) { beforeLine = editor . getLine ( ) ; beforeColumn = editor . getColumn ( ) ; doExecute ( ) ; afterLine = editor . getLine ( ) ; afterColumn = editor . getColumn ( ) ; }
Stores cursor coordinates .
11,036
public Date setMaxSelectableDate ( Date max ) { if ( max == null ) { maxSelectableDate = defaultMaxSelectableDate ; } else { maxSelectableDate = max ; } return maxSelectableDate ; }
Sets the maximum selectable date . If null the date 01 \ 01 \ 9999 will be set instead .
11,037
public Date setMinSelectableDate ( Date min ) { if ( min == null ) { minSelectableDate = defaultMinSelectableDate ; } else { minSelectableDate = min ; } return minSelectableDate ; }
Sets the minimum selectable date . If null the date 01 \ 01 \ 0001 will be set instead .
11,038
public boolean checkDate ( Date date ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; calendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar . set ( Calendar . MILLISECOND , 0 ) ; Calendar minCal = ...
Checks a given date if it is in the formally specified date range .
11,039
public static Builder getSettingsBuilder ( String nodeName , boolean clientTransportSniff , String clusterName ) { boolean isNullClusterName = Objects . isNull ( clusterName ) ; Builder builder = Settings . builder ( ) . put ( NODE_NAME , nodeName ) . put ( CLIENT_TRANSPORT_SNIFF , clientTransportSniff ) . put ( CLIENT...
Gets settings builder .
11,040
public boolean isExists ( String index ) { IndicesExistsRequestBuilder indicesExistsRequestBuilder = admin ( ) . indices ( ) . prepareExists ( index ) ; return JMElasticsearchUtil . logRequestQueryAndReturn ( "isExists" , indicesExistsRequestBuilder , indicesExistsRequestBuilder . execute ( ) ) . isExists ( ) ; }
Is exists boolean .
11,041
public boolean create ( String index ) { CreateIndexRequestBuilder createIndexRequestBuilder = admin ( ) . indices ( ) . prepareCreate ( index ) ; return JMElasticsearchUtil . logRequestQueryAndReturn ( "create" , createIndexRequestBuilder , createIndexRequestBuilder . execute ( ) ) . isAcknowledged ( ) ; }
Create boolean .
11,042
public List < String > getAllIdList ( String index , String type ) { return extractIdList ( searchAll ( index , type ) ) ; }
Gets all id list .
11,043
public ImmutableOpenMap < String , ImmutableOpenMap < String , MappingMetaData > > getMappingsResponse ( String ... indices ) { GetMappingsRequestBuilder getMappingsRequestBuilder = admin ( ) . indices ( ) . prepareGetMappings ( indices ) ; return JMElasticsearchUtil . logRequestQueryAndReturn ( "getMappingsResponse" ,...
Gets mappings response .
11,044
public Map < String , IndexStats > getAllIndicesStats ( ) { IndicesStatsRequestBuilder indicesStatsRequestBuilder = admin ( ) . indices ( ) . prepareStats ( ) . all ( ) ; return JMElasticsearchUtil . logRequestQueryAndReturn ( "getAllIndicesStats" , indicesStatsRequestBuilder , indicesStatsRequestBuilder . execute ( ) ...
Gets all indices stats .
11,045
public List < String > getFilteredIndexList ( String containedString ) { return getAllIndices ( ) . stream ( ) . filter ( index -> index . contains ( containedString ) ) . collect ( toList ( ) ) ; }
Gets filtered index list .
11,046
public Optional < Map < String , ? > > getMappings ( String index , String type ) { try { return Optional . of ( getMappingsResponse ( index ) . get ( index ) . get ( type ) . getSourceAsMap ( ) ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnEmptyOptional ( log , e , "getMappings" , i...
Gets mappings .
11,047
public boolean readBoolean ( String message , Boolean defaultValue ) throws IOException { saveCursorPosition ( ) ; Ansi style = ansi ( ) ; if ( getTheme ( ) . getPromptBackground ( ) != null ) { style . bg ( getTheme ( ) . getPromptBackground ( ) ) ; } if ( getTheme ( ) . getPromptForeground ( ) != null ) { style . fg ...
Displays a message and reads a boolean from the user input . The mapping of the user input to a boolean value is specified by the implementation .
11,048
public String readLine ( ) throws IOException { StringBuilder lineBuilder = new StringBuilder ( ) ; EditorOperation operation ; while ( true ) { operation = readOperation ( ) ; switch ( operation . getType ( ) ) { case BACKSAPCE : case DELETE : if ( lineBuilder . length ( ) > 0 ) { lineBuilder . delete ( lineBuilder . ...
Reads a line from the user input .
11,049
void repaintScreen ( ) { int repaintLine = 1 ; console . out ( ) . print ( ansi ( ) . eraseScreen ( Erase . ALL ) ) ; console . out ( ) . print ( ansi ( ) . cursor ( 1 , 1 ) ) ; console . out ( ) . print ( "\33[" + ( getHeaderSize ( ) + 1 ) + ";" + ( terminal . getHeight ( ) - getFooterSize ( ) ) + ";r" ) ; redrawHeade...
Repaints the whole screen .
11,050
void redrawRestOfLine ( ) { int maxLinesToRepaint = terminal . getHeight ( ) - getFooterSize ( ) - frameLine ; LinkedList < String > toRepaintLines = new LinkedList < String > ( ) ; String currentLine = getContent ( getLine ( ) ) ; toRepaintLines . addAll ( toDisplayLines ( currentLine ) ) ; int remainingLines = ( getC...
Redraws the rest of the multi line .
11,051
void redrawRestOfScreen ( ) { int linesToRepaint = terminal . getHeight ( ) - getFooterSize ( ) - frameLine ; LinkedList < String > toRepaintLines = new LinkedList < String > ( ) ; String currentLine = getContent ( getLine ( ) ) ; toRepaintLines . addAll ( toDisplayLines ( currentLine ) ) ; int remainingLines = Math . ...
Redraws content from the current line to the end of the frame .
11,052
private void moveVertical ( int offset ) { if ( offset < 0 ) { moveUp ( Math . abs ( offset ) ) ; } else if ( offset > 0 ) { moveDown ( offset ) ; } }
Moves the cursor vertically and scroll if needed .
11,053
private void moveHorizontally ( int offset ) { if ( offset < 0 ) { moveLeft ( Math . abs ( offset ) ) ; } else if ( offset > 0 ) { moveRight ( offset ) ; } }
Moves the cursor horizontally .
11,054
protected void displayText ( String text ) { if ( highLight != null && ! highLight . isEmpty ( ) && text . contains ( highLight ) ) { String highLightedText = text . replaceAll ( highLight , ansi ( ) . bold ( ) . bg ( theme . getHighLightBackground ( ) ) . fg ( theme . getHighLightForeground ( ) ) . a ( highLight ) . b...
Displays Text highlighting the text that was marked as highlighted .
11,055
private LinkedList < String > toDisplayLines ( String line ) { LinkedList < String > displayLines = new LinkedList < String > ( ) ; if ( line . length ( ) <= terminal . getWidth ( ) ) { displayLines . add ( line ) ; } else { int total = Math . max ( 0 , line . length ( ) - 1 ) / terminal . getWidth ( ) + 1 ; int startI...
Creates a list of lines that represent how the line will be displayed on screen .
11,056
public static JTextField getDateField ( String format ) { JTextField field = new JTextField ( ) ; field . setEditable ( false ) ; timePicker ( field ) ; return field ; }
Get time field with format
11,057
public String load ( String location ) throws IOException { File file = new File ( location ) ; return Files . toString ( file , detectCharset ( location ) ) ; }
Loads content from the specified location .
11,058
public boolean save ( String content , String location ) { return save ( content , Charsets . UTF_8 , location ) ; }
Saves content to the specified location .
11,059
public void setYear ( int y ) { super . setValue ( y , true , false ) ; if ( dayChooser != null ) { dayChooser . setYear ( value ) ; } spinner . setValue ( new Integer ( value ) ) ; firePropertyChange ( "year" , oldYear , value ) ; oldYear = value ; }
Sets the year . This is a bound property .
11,060
public Environment extract ( Object specification ) { Assert . notNull ( specification , "The 'specification' argument cannot be null." ) ; final Environment environment = new Environment ( ) ; final Class < ? > clazz = specification . getClass ( ) ; final Jndi annotation = AnnotationUtils . findAnnotation ( clazz , Jn...
Extracts the environment from the test object .
11,061
public void putState ( String key , String value ) { handler . handlePutState ( key , ByteString . copyFromUtf8 ( value ) , uuid ) ; }
Puts the given state into a ledger automatically wrapping it in a ByteString
11,062
public Map < String , String > rangeQueryState ( String startKey , String endKey ) { Map < String , String > retMap = new HashMap < > ( ) ; for ( Map . Entry < String , ByteString > item : rangeQueryRawState ( startKey , endKey ) . entrySet ( ) ) { retMap . put ( item . getKey ( ) , item . getValue ( ) . toStringUtf8 (...
Given a start key and end key this method returns a map of items with value converted to UTF - 8 string .
11,063
public Map < String , ByteString > rangeQueryRawState ( String startKey , String endKey ) { Map < String , ByteString > map = new HashMap < > ( ) ; for ( Chaincode . RangeQueryStateKeyValue mapping : handler . handleRangeQueryState ( startKey , endKey , uuid ) . getKeysAndValuesList ( ) ) { map . put ( mapping . getKey...
This method is same as rangeQueryState except it returns value in ByteString useful in cases where serialized object can be retrieved .
11,064
public ByteString invokeRawChaincode ( String chaincodeName , String function , List < ByteString > args ) { return handler . handleInvokeChaincode ( chaincodeName , function , args , uuid ) ; }
Invokes the provided chaincode with the given function and arguments and returns the raw ByteString value that invocation generated .
11,065
private void findPrinters ( ) { mOauthObservable . subscribe ( new Action1 < String > ( ) { public void call ( final String token ) { searchPrinters ( token ) . subscribe ( new Action1 < JacksonPrinterSearchResult > ( ) { public void call ( JacksonPrinterSearchResult result ) { onPrinterSearchResult ( result ) ; } } , ...
Finds printers associated with the account .
11,066
public TimeDuration dividedBy ( int factor ) { return createWithCarry ( sec / factor , ( ( sec % factor ) * NANOSEC_IN_SEC + ( long ) nanoSec ) / factor ) ; }
Returns a new duration which is smaller by the given factor .
11,067
public int dividedBy ( TimeDuration duration ) { double thisDuration = ( double ) getSec ( ) * ( double ) NANOSEC_IN_SEC + ( double ) getNanoSec ( ) ; double otherDuration = ( double ) duration . getSec ( ) * ( double ) NANOSEC_IN_SEC + ( double ) duration . getNanoSec ( ) ; return ( int ) ( thisDuration / otherDuratio...
Returns the number of times the given duration is present in this duration .
11,068
public TimeDuration plus ( TimeDuration duration ) { return createWithCarry ( sec + duration . getSec ( ) , nanoSec + duration . getNanoSec ( ) ) ; }
Returns the sum of this duration with the given .
11,069
public TimeDuration minus ( TimeDuration duration ) { return createWithCarry ( sec - duration . getSec ( ) , nanoSec - duration . getNanoSec ( ) ) ; }
Returns the difference between this duration and the given .
11,070
public TimeInterval around ( Timestamp reference ) { TimeDuration half = this . dividedBy ( 2 ) ; return TimeInterval . between ( reference . minus ( half ) , reference . plus ( half ) ) ; }
Returns a time interval that lasts this duration and is centered around the given timestamp .
11,071
public Collection < Project > getTargetedBy ( ProjectFilter filter ) { filter = ( filter != null ) ? filter : new ProjectFilter ( ) ; filter . targets . clear ( ) ; filter . targets . add ( this ) ; return getInstance ( ) . get ( ) . projects ( filter ) ; }
A collection of Projects Targeted by this Goal .
11,072
public Collection < Epic > getEpics ( EpicFilter filter ) { filter = ( filter != null ) ? filter : new EpicFilter ( ) ; filter . goals . clear ( ) ; filter . goals . add ( this ) ; return getInstance ( ) . get ( ) . epics ( filter ) ; }
Epics assigned to this Goal .
11,073
public Collection < Theme > getThemes ( ThemeFilter filter ) { filter = ( filter != null ) ? filter : new ThemeFilter ( ) ; filter . goals . clear ( ) ; filter . goals . add ( this ) ; return getInstance ( ) . get ( ) . themes ( filter ) ; }
Themes assigned to this Goal .
11,074
public boolean isRobotPermitted ( String url , String userAgent ) throws IOException , RobotsUnavailableException { RobotRules rules = getRulesForUrl ( url , userAgent ) ; return ! rules . blocksPathForUA ( new LaxURI ( url , false ) . getPath ( ) , userAgent ) ; }
Returns true if a robot with the given user - agent is allowed to access the given url .
11,075
private void addMonth ( int i ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( getDisplayYear ( ) , getDisplayMonth ( ) - 1 , 1 ) ; int month = cal . get ( Calendar . MONTH ) + 1 ; if ( i > 0 && month == 12 ) { addYear ( 1 ) ; } if ( i < 0 && month == 1 ) { addYear ( - 1 ) ; } cal . add ( Calendar . MONTH , ...
Add month count to month field
11,076
private void addYear ( int i ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( getDisplayYear ( ) , 1 , 1 ) ; cal . add ( Calendar . YEAR , i ) ; yearTextField . setText ( String . valueOf ( cal . get ( Calendar . YEAR ) ) ) ; }
Add year count to year field
11,077
private String [ ] getDays ( int year , int month ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( year , month , 1 ) ; int dayNum = cal . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; String [ ] days = new String [ dayNum ] ; for ( int i = 0 ; i < dayNum ; i ++ ) { days [ i ] = String . valueOf ( i + 1 ) ;...
Get days of a month
11,078
private int getDayIndex ( int year , int month , int day ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( year , month , day ) ; return cal . get ( Calendar . DAY_OF_WEEK ) ; }
Get DAY_OF_WEEK of a day
11,079
private Date [ ] getBeforeDays ( int year , int month ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( year , month , 1 ) ; int dayNum = getDayIndex ( year , month , 1 ) - 1 ; Date [ ] date = new Date [ dayNum ] ; if ( dayNum > 0 ) for ( int i = 0 ; i < dayNum ; i ++ ) { cal . add ( Calendar . DAY_OF_MONTH ,...
Get date arrays before 1st day of the month in that week
11,080
private Date [ ] getAfterDays ( int year , int month ) { Calendar cal = Calendar . getInstance ( ) ; cal . set ( Calendar . YEAR , year ) ; cal . set ( Calendar . MONTH , month ) ; int dayNum = cal . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; cal . set ( year , month , dayNum ) ; int afterDayNum = 7 - getDayIndex (...
Get date arrays after the last day of the month in that week
11,081
private void addDayHeadLabels ( ) { for ( JLabel it : getDayHeadLabels ( ) ) { it . setVerticalAlignment ( JLabel . CENTER ) ; it . setHorizontalAlignment ( JLabel . CENTER ) ; daysPanel . add ( it ) ; } }
Add day header to top of month btns
11,082
@ SuppressWarnings ( "deprecation" ) private void refreshDayBtns ( ) { remove ( daysPanel ) ; daysPanel = new JPanel ( ) ; daysPanel . removeAll ( ) ; daysPanel . setLayout ( new GridLayout ( 0 , 7 ) ) ; int displayYear = getDisplayYear ( ) ; int displayMonth = getDisplayMonth ( ) ; String [ ] days = getDays ( displayY...
Refresh day btn tables
11,083
protected List < Middleware > getMiddleware ( String name ) { final List < Middleware > middleware = this . applicationContext . getBeansOfType ( MiddlewareDefinition . class , true , false ) . values ( ) . stream ( ) . flatMap ( d -> d . getDefinition ( ) . entrySet ( ) . stream ( ) ) . collect ( Collectors . toMap ( ...
Resolves middleware assigned to action by it s name .
11,084
public static MapOperator with ( final Map map , final Class < ? extends Map > nodeClass ) { return new MapOperator ( map , nodeClass ) ; }
Entry point for mutable map dsl .
11,085
public void mimicClass ( CtClass src , CtClass dst , MimicMode defaultMimicMode , MimicMethod [ ] mimicMethods ) throws NotFoundException , CannotCompileException , MimicException { mimicInterfaces ( src , dst ) ; mimicFields ( src , dst ) ; mimicConstructors ( src , dst ) ; mimicMethods ( src , dst , defaultMimicMode ...
Copies all fields constructors and methods declared in class src into dst . All interfaces implemented by src will also be implemented by dst .
11,086
public void doFilter ( ServletRequest req , ServletResponse res , FilterChain chain ) throws IOException , ServletException { HttpServletResponse response = ( HttpServletResponse ) res ; response . setHeader ( "Access-Control-Allow-Origin" , allowOrigin ) ; response . setHeader ( "Access-Control-Allow-Methods" , allowM...
Sets the headers to support CORS
11,087
public void decodeHeader ( ) throws IOException { if ( ! headerDecoded ) { headerDecoded = true ; int m = getMarker ( ) ; if ( m != 0xD8 ) { throw new IOException ( "no SOI" ) ; } m = getMarker ( ) ; while ( m != 0xC0 && m != 0xC1 ) { processMarker ( m ) ; m = getMarker ( ) ; while ( m == MARKER_NONE ) { m = getMarker ...
Decodes the JPEG header . This must be called before the image size can be queried .
11,088
public boolean startDecode ( ) throws IOException { if ( insideSOS ) { throw new IllegalStateException ( "decode already started" ) ; } if ( foundEOI ) { return false ; } decodeHeader ( ) ; int m = getMarker ( ) ; while ( m != 0xD9 ) { if ( m == 0xDA ) { processScanHeader ( ) ; insideSOS = true ; currentMCURow = 0 ; re...
Starts the decode process . This will advance the JPEG stream to the start of the image data . It also checks if that JPEG file can be decoded by this library .
11,089
public void decodeRAW ( ByteBuffer [ ] buffer , int [ ] strides , int numMCURows ) throws IOException { if ( ! insideSOS ) { throw new IllegalStateException ( "decode not started" ) ; } if ( numMCURows <= 0 || currentMCURow + numMCURows > mcuCountY ) { throw new IllegalArgumentException ( "numMCURows" ) ; } int scanN =...
Decodes each color component of the JPEG file separately into a separate ByteBuffer . The number of buffers must match the number of color channels . Each color channel can have a different sub sampling factor .
11,090
public void decodeDCTCoeffs ( ShortBuffer [ ] buffer , int numMCURows ) throws IOException { if ( ! insideSOS ) { throw new IllegalStateException ( "decode not started" ) ; } if ( numMCURows <= 0 || currentMCURow + numMCURows > mcuCountY ) { throw new IllegalArgumentException ( "numMCURows" ) ; } int scanN = order . le...
Decodes the dequantizied DCT coefficients into a buffer per color component . The number of buffers must match the number of color channels . Each color channel can have a different sub sampling factor .
11,091
public boolean validate ( Entity entity , String attribute ) throws APIException , ConnectionException , OidException { Asset asset = v1Instance . getAsset ( entity . getInstanceKey ( ) ) != null ? v1Instance . getAsset ( entity . getInstanceKey ( ) ) : v1Instance . getAsset ( entity . getID ( ) ) ; IAttributeDefinitio...
Validate single attribute of an entity .
11,092
public List < String > validate ( Entity entity ) throws APIException , ConnectionException , OidException { Asset asset = v1Instance . getAsset ( entity . getInstanceKey ( ) ) != null ? v1Instance . getAsset ( entity . getInstanceKey ( ) ) : v1Instance . getAsset ( entity . getID ( ) ) ; return validate ( asset ) ; }
Validate single Entity .
11,093
public Map < Entity , List < String > > validate ( Entity [ ] entities ) throws APIException , ConnectionException , OidException { Map < Entity , List < String > > results = new HashMap < Entity , List < String > > ( ) ; for ( Entity entity : entities ) { results . put ( entity , validate ( entity ) ) ; } return resul...
Validate a collection of entities .
11,094
public Image getIcon ( int iconKind ) { switch ( iconKind ) { case ICON_COLOR_16x16 : return iconColor16 ; case ICON_COLOR_32x32 : return iconColor32 ; case ICON_MONO_16x16 : return iconMono16 ; case ICON_MONO_32x32 : return iconMono32 ; } return null ; }
This method returns an image object that can be used to represent the bean in toolboxes toolbars etc .
11,095
public Attachment createAttachment ( String name , String fileName , InputStream stream ) throws AttachmentLengthExceededException , ApplicationUnavailableException { return getInstance ( ) . create ( ) . attachment ( name , this , fileName , stream ) ; }
Create an attachment that belongs to this asset .
11,096
public Conversation createConversation ( Member author , String content ) { Conversation conversation = getInstance ( ) . create ( ) . conversation ( author , content ) ; Iterator < Expression > iterator = conversation . getContainedExpressions ( ) . iterator ( ) ; iterator . next ( ) . getMentions ( ) . add ( this ) ;...
Creates conversation with an expression which mentioned this asset .
11,097
public void propertyChange ( PropertyChangeEvent evt ) { if ( calendar != null ) { Calendar c = ( Calendar ) calendar . clone ( ) ; if ( evt . getPropertyName ( ) . equals ( "day" ) ) { c . set ( Calendar . DAY_OF_MONTH , ( ( Integer ) evt . getNewValue ( ) ) . intValue ( ) ) ; setCalendar ( c , false ) ; } else if ( e...
JCalendar is a PropertyChangeListener for its day month and year chooser .
11,098
public void setBackground ( Color bg ) { super . setBackground ( bg ) ; if ( dayChooser != null ) { dayChooser . setBackground ( bg ) ; } }
Sets the background color .
11,099
private void setCalendar ( Calendar c , boolean update ) { if ( c == null ) { setDate ( null ) ; } Calendar oldCalendar = calendar ; calendar = c ; if ( update ) { yearChooser . setYear ( c . get ( Calendar . YEAR ) ) ; monthChooser . setMonth ( c . get ( Calendar . MONTH ) ) ; dayChooser . setDay ( c . get ( Calendar ...
Sets the calendar attribute of the JCalendar object