idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
19,000
public static JinxConstants . GroupPrivacy privacyIdToGroupPrivacyEnum ( Integer id ) { if ( id == null ) { return null ; } JinxConstants . GroupPrivacy privacy ; switch ( id ) { case 1 : privacy = JinxConstants . GroupPrivacy . group_private ; break ; case 2 : privacy = JinxConstants . GroupPrivacy . group_invite_only...
Convert a Flickr group privacy numeric identifier to the corresponding GroupPrivacy enum value .
19,001
public static Integer suggestionStatusToFlickrSuggestionStatusId ( JinxConstants . SuggestionStatus status ) { if ( status == null ) { return null ; } Integer id ; switch ( status ) { case pending : id = 0 ; break ; case approved : id = 1 ; break ; case rejected : id = 2 ; break ; default : id = null ; break ; } return...
Convert a suggestion status to the corresponding Flickr suggestion status id .
19,002
public static JinxConstants . SuggestionStatus suggestionStatusIdToSuggestionStatusEnum ( Integer id ) { if ( id == null ) { return null ; } JinxConstants . SuggestionStatus status ; switch ( id ) { case 0 : status = JinxConstants . SuggestionStatus . pending ; break ; case 1 : status = JinxConstants . SuggestionStatus...
Convert a Flickr suggestion status id to the corresponding SuggestionStatus value .
19,003
public PhotosetInfo getInfo ( String photosetId ) throws JinxException { JinxUtils . validateParams ( photosetId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photosets.getInfo" ) ; params . put ( "photoset_id" , photosetId ) ; return jinx . flickrGet ( params , PhotosetIn...
Gets information about a photoset . This method does not require authentication .
19,004
public Domains getCollectionDomains ( Date date , String collectionId , Integer perPage , Integer page ) throws JinxException { JinxUtils . validateParams ( date ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getCollectionDomains" ) ; params . put ( "date" , JinxUtils...
Get a list of referring domains for a collection
19,005
public Stats getPhotosetStats ( Date date , String photosetId ) throws JinxException { JinxUtils . validateParams ( date , photosetId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getPhotosetStats" ) ; params . put ( "date" , JinxUtils . formatDateAsYMD ( date ) ) ; ...
Get the number of views on a photoset for a given date .
19,006
public Photos getPopularPhotos ( Date date , JinxConstants . PopularPhotoSort sort , Integer perPage , Integer page ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getPopularPhotos" ) ; if ( date != null ) { params . put ( "date" , JinxUtils . form...
List the photos with the most views comments or favorites
19,007
public GroupUrls getGroup ( String groupId ) throws JinxException { JinxUtils . validateParams ( groupId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.getGroup" ) ; params . put ( "group_id" , groupId ) ; return jinx . flickrGet ( params , GroupUrls . class , false ) ...
Returns the url to a group s page .
19,008
public UserUrls getUserPhotos ( String userId ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.getUserPhotos" ) ; if ( ! JinxUtils . isNullOrEmpty ( userId ) ) { params . put ( "user_id" , userId ) ; } return jinx . flickrGet ( params , UserUrls . cl...
Returns the url to a user s photos .
19,009
public GalleryInfo lookupGallery ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupGallery" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , GalleryInfo . class ) ; }
Returns gallery info by url .
19,010
public GroupUrls lookupGroup ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupGroup" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , GroupUrls . class , false ) ; }
Returns a group NSID given the url to a group s page or photo pool .
19,011
public UserUrls lookupUser ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupUser" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , UserUrls . class ) ; }
Returns a user NSID given the url to a user s photos or profile .
19,012
public synchronized void storeToXML ( OutputStream os , String comment ) throws IOException { if ( os == null ) throw new NullPointerException ( ) ; storeToXML ( os , comment , "UTF-8" ) ; }
Emits an XML document representing all of the properties contained in this table .
19,013
public void list ( PrintStream out ) { out . println ( "-- listing properties --" ) ; Hashtable h = new Hashtable ( ) ; enumerate ( h ) ; for ( Enumeration e = h . keys ( ) ; e . hasMoreElements ( ) ; ) { String key = ( String ) e . nextElement ( ) ; String val = ( String ) h . get ( key ) ; if ( val . length ( ) > 40 ...
Prints this property list out to the specified output stream . This method is useful for debugging .
19,014
public Response browse ( String categoryId ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.groups.browse" ) ; return jinx . flickrGet ( params , Response . class ) ; }
This is a legacy method and will not return anything useful .
19,015
public void setoAuthAccessToken ( OAuthAccessToken oAuthAccessToken ) { this . oAuthAccessToken = oAuthAccessToken ; this . accessToken = new Token ( oAuthAccessToken . getOauthToken ( ) , oAuthAccessToken . getOauthTokenSecret ( ) ) ; }
Set the oauth access token .
19,016
public static void setDecodeHintAllowedLengths ( Intent intent , int [ ] lengths ) { intent . putExtra ( DecodeHintType . ALLOWED_LENGTHS . name ( ) , lengths ) ; }
Set allowed lengths of encoded data .
19,017
public PlaceInfo getInfo ( String placeId , String woeId ) throws JinxException { if ( JinxUtils . isNullOrEmpty ( placeId ) ) { JinxUtils . validateParams ( woeId ) ; } Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.places.getInfo" ) ; if ( JinxUtils . isNullOrEmpty ( placeId ...
Get information about a place . Authentication This method does not require authentication . You must provide a valid placesId or woeId . If you provide both the placesId will be used .
19,018
public Places getPlacesForBoundingBox ( String boundingBox , JinxConstants . PlaceTypeId placeTypeId ) throws JinxException { JinxUtils . validateParams ( boundingBox , placeTypeId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.places.placesForBoundingBox" ) ; params . put ...
Return all the locations of a matching place type for a bounding box .
19,019
public Places getPlacesForContacts ( JinxConstants . PlaceTypeId placeTypeId , String placeId , String woeId , Integer threshold , JinxConstants . Contacts contacts , Date minimumUploadDate , Date maximumUploadDate , Date minimumTakenDate , Date maximumTakenDate ) throws JinxException { JinxUtils . validateParams ( pla...
Return a list of the top 100 unique places clustered by a given placetype for a user s contacts .
19,020
public Methods getMethods ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.reflection.getMethods" ) ; return jinx . flickrGet ( params , Methods . class , false ) ; }
Returns a list of available Flickr API methods .
19,021
public MethodInfo getMethodInfo ( String methodName ) throws JinxException { JinxUtils . validateParams ( methodName ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.reflection.getMethodInfo" ) ; params . put ( "method_name" , methodName ) ; return jinx . flickrGet ( params ,...
Returns information for a given Flickr API method .
19,022
public Clusters getClusters ( String tag ) throws JinxException { JinxUtils . validateParams ( tag ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getClusters" ) ; params . put ( "tag" , tag ) ; return jinx . flickrGet ( params , Clusters . class , false ) ; }
Gives you a list of tag clusters for the given tag .
19,023
public PhotoTagList getListPhoto ( String photoId ) throws JinxException { JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getListPhoto" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , PhotoTagList . cl...
Get the tag list for a given photo .
19,024
public TagsForUser getMostFrequentlyUsed ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getMostFrequentlyUsed" ) ; return jinx . flickrGet ( params , TagsForUser . class ) ; }
Returns a list of most frequently used tags for a user .
19,025
public RelatedTags getRelated ( String tag ) throws JinxException { JinxUtils . validateParams ( tag ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getRelated" ) ; params . put ( "tag" , tag ) ; return jinx . flickrGet ( params , RelatedTags . class ) ; }
Returns a list of tags related to the given tag based on clustered usage analysis .
19,026
public String getPhotosFirstDateTaken ( ) { return ( person == null || person . photos == null || person . photos . firstDateTaken == null ) ? null : person . photos . firstDateTaken . _content ; }
Get the mysql datetime of the first photo taken by the user .
19,027
public String getPhotosFirstDate ( ) { return ( person == null || person . photos == null || person . photos . firstDate == null ) ? null : person . photos . firstDate . _content ; }
Get the unix timestamp of the first photo uploaded by the user .
19,028
public CameraModels getBrandModels ( String brandId ) throws JinxException { JinxUtils . validateParams ( brandId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.cameras.getBrandModels" ) ; params . put ( "brand" , brandId ) ; return jinx . flickrGet ( params , CameraModels ...
Retrieve all the models for a given camera brand . This method does not require authentication .
19,029
public static String generateAuthorizeUrl ( String oAuthUri , String clientId , String [ ] scope ) { StringBuilder sb = new StringBuilder ( oAuthUri ) ; sb . append ( "/oauth/authorize?response_type=code" ) ; sb . append ( "&client_id=" + clientId ) ; if ( scope != null ) { sb . append ( "&scope=" ) ; for ( int i = 0 ;...
Generates the initial url for the OAuth authorization flow
19,030
public Response correctLocation ( String photoId , String placeId , String woeId , String foursquareId ) throws JinxException { JinxUtils . validateParams ( photoId ) ; if ( JinxUtils . isNullOrEmpty ( placeId ) ) { JinxUtils . validateParams ( woeId ) ; } Map < String , String > params = new TreeMap < > ( ) ; params ....
This method requires authentication with write permission .
19,031
public GalleryInfo galleryInfo ( String galleryId ) throws JinxException { JinxUtils . validateParams ( galleryId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.galleries.getInfo" ) ; params . put ( "gallery_id" , galleryId ) ; return jinx . flickrPost ( params , GalleryInf...
This method does not require authentication .
19,032
public Subscriptions getSubscriptions ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.getSubscriptions" ) ; return jinx . flickrGet ( params , Subscriptions . class ) ; }
Returns a list of the subscriptions for the logged - in user .
19,033
public Topics getTopics ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.getTopics" ) ; return jinx . flickrGet ( params , Topics . class ) ; }
Get all available push topics .
19,034
public Response subscribe ( String topic , String callbackUrl , JinxConstants . VerificationMode mode , String verificationToken , Integer leaseSeconds , Integer woeIds , List < String > placeIds , Float latitude , Float longitude , Integer radius , JinxConstants . RadiusUnits radiusUnits , Integer accuracy , List < St...
Subscribe to a push feed .
19,035
public Response unsubscribe ( String topic , String callbackUrl , JinxConstants . VerificationMode mode , String verificationToken ) throws JinxException { JinxUtils . validateParams ( topic , callbackUrl , mode ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.unsubscrib...
Unsubscribe from a push feed .
19,036
public void log ( String message , Throwable t ) { System . out . println ( message ) ; System . out . println ( getStackTrace ( t ) ) ; }
Log message to stdout along with exception information .
19,037
public synchronized void stopPreview ( ) { if ( autoFocusManager != null ) { autoFocusManager . stop ( ) ; autoFocusManager = null ; } if ( camera != null && previewing ) { camera . stopPreview ( ) ; previewCallback . setHandler ( null , 0 ) ; previewing = false ; } }
Tells the camera to stop drawing preview frames .
19,038
public Integer getPerPage ( ) { int ret = 0 ; if ( photos != null ) { int pp ; if ( photos . perpage == null ) { pp = 0 ; } else { pp = photos . perpage ; } int pP ; if ( photos . perPage == null ) { pP = 0 ; } else { pP = photos . perPage ; } if ( pp > pP ) { ret = pp ; } else { ret = pP ; } } return ret ; }
Get the number of photos per page . This value is returned by flickr as per_page and perpage depending on the method that was called . This class can parse either value and will return whichever one was found .
19,039
public String getComment ( String key ) { String raw = getRawComment ( key ) ; return cookComment ( raw ) ; }
Returns the comment for the specified key or null if there is none . Any embedded newline sequences will be replaced by \ n characters .
19,040
public static BufferedImage getImageForSize ( JinxConstants . PhotoSize size , Photo photo ) throws JinxException { if ( photo == null || size == null ) { throw new JinxException ( "Cannot look up null photo or size." ) ; } BufferedImage image ; try { image = ImageIO . read ( getUrlForSize ( size , photo ) ) ; } catch ...
Get an image for a photo at a specific size .
19,041
public static BufferedImage getImageForSize ( JinxConstants . PhotoSize size , PhotoInfo info ) throws JinxException { if ( info == null || size == null ) { throw new JinxException ( "Cannot look up null photo or size." ) ; } BufferedImage image ; try { image = ImageIO . read ( getUrlForSize ( size , info ) ) ; } catch...
Get an image for photo info at a specific size .
19,042
public static URL getUrlForSize ( JinxConstants . PhotoSize size , String photoId , String secret , String farm , String server , String originalFormat , String originalSecret ) throws JinxException { JinxUtils . validateParams ( photoId , size , farm , server ) ; if ( size == JinxConstants . PhotoSize . SIZE_ORIGINAL ...
Get the URL for a specific size of photo .
19,043
public Person getContentType ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.prefs.getContentType" ) ; return jinx . flickrGet ( params , Person . class ) ; }
Returns the default content type preference for the user .
19,044
public boolean cancelJob ( String slaveJobId ) { final AnalysisResultFuture resultFuture = _runningJobs . remove ( slaveJobId ) ; if ( resultFuture != null ) { resultFuture . cancel ( ) ; return true ; } return false ; }
Cancels a slave job referred by it s id .
19,045
protected final boolean entityExists ( final String entityName ) { final Set < EntityType < ? > > entityTypes = getEm ( ) . getMetamodel ( ) . getEntities ( ) ; for ( final EntityType < ? > entityType : entityTypes ) { if ( entityType . getName ( ) . equals ( entityName ) ) { return true ; } } return false ; }
Returns if an entity with agiven name exists .
19,046
protected final String createJpqlStreamSelect ( final StreamId streamId ) { if ( streamId . isProjection ( ) ) { throw new IllegalArgumentException ( "Projections do not have a stream table : " + streamId ) ; } final List < KeyValue > params = new ArrayList < > ( streamId . getParameters ( ) ) ; if ( params . size ( ) ...
Creates the JPQL to select the stream itself .
19,047
protected final JpaStream findStream ( final StreamId streamId ) { Contract . requireArgNotNull ( "streamId" , streamId ) ; verifyStreamEntityExists ( streamId ) ; final String sql = createJpqlStreamSelect ( streamId ) ; final TypedQuery < JpaStream > query = getEm ( ) . createQuery ( sql , JpaStream . class ) ; setJpq...
Reads the stream with the given identifier from the DB and returns it .
19,048
private final String createNativeSqlEventSelect ( final StreamId streamId , final List < NativeSqlCondition > conditions ) { final StringBuilder sb = new StringBuilder ( "SELECT " + JPA_EVENT_PREFIX + ".* FROM " + JpaEvent . TABLE_NAME + " " + JPA_EVENT_PREFIX + ", " + nativeEventsTableName ( streamId ) + " " + JPA_STR...
Creates a native SQL select using the parameters from the stream identifier and optional other arguments .
19,049
public void delete ( final boolean hardDelete ) { if ( hardDelete ) { this . state = StreamState . HARD_DELETED . dbValue ( ) ; } else { this . state = StreamState . SOFT_DELETED . dbValue ( ) ; } }
Marks the stream as deleted .
19,050
public boolean removeDatastore ( final String datastoreName ) { final Element datastoreCatalogElement = getDatastoreCatalogElement ( ) ; final NodeList childNodes = datastoreCatalogElement . getChildNodes ( ) ; final int length = childNodes . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { final Node node = chi...
Removes a datastore by it s name if it exists and is recognizeable by the externalizer .
19,051
public final void add ( final SerializedDataType type , final String contentType , final SerDeserializer serDeserializer ) { this . addSerializer ( type , serDeserializer ) ; this . addDeserializer ( type , contentType , serDeserializer ) ; }
Convenience method that adds both a new serializer and deserializer to the registry .
19,052
public final void addDeserializer ( final SerializedDataType type , final String contentType , final Deserializer deserializer ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "contentType" , contentType ) ; Contract . requireArgNotNull ( "deserializer" , deserializer ) ; final Key ke...
Adds a new deserializer to the registry .
19,053
public final void setDefaultContentType ( final SerializedDataType type , final EnhancedMimeType contentType ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "contentType" , contentType ) ; contentTypes . put ( type , contentType ) ; }
Sets the default content type to use if no content type is given .
19,054
public final void addSerializer ( final SerializedDataType type , final Serializer serializer ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "serializer" , serializer ) ; serMap . put ( type , serializer ) ; }
Adds a new serializer to the registry .
19,055
public void compileProgram ( ) { program . inputs ( ) . forEach ( var -> var . calculateFuzzySpace ( ) ) ; program . outputs ( ) . forEach ( var -> var . calculateFuzzySpace ( ) ) ; program . rules ( ) . forEach ( rule -> { updateMemberReferenceCount ( rule . getCondition ( ) ) ; rule . assignmentMembers ( ) . forEach ...
Compile the program
19,056
public MutableInputColumn < ? > getOutputColumnByName ( String name ) { if ( StringUtils . isNullOrEmpty ( name ) ) { return null ; } final List < MutableInputColumn < ? > > outputColumns = getOutputColumns ( ) ; for ( MutableInputColumn < ? > inputColumn : outputColumns ) { if ( name . equals ( inputColumn . getName (...
Gets an output column by name .
19,057
public static InvalidEntityKanbaneryException mostSpecializedException ( String response ) { if ( response == null || "" . equals ( response ) ) { return new InvalidEntityKanbaneryException ( response ) ; } else if ( TaskAlreadyInFirstColumnException . isBestExceptionFor ( response ) ) { return new TaskAlreadyInFirstCo...
May be used as Exception factory to determine the best exception to be thrown for such JSON response . For example we may throw TaskAlreadyInFirstColumnException if the JSON contains a message informing us about this .
19,058
public void init ( ) { logger . info ( "Initializing dictionary: {}" , this ) ; Datastore datastore = getDatastore ( ) ; DatastoreConnection dataContextProvider = datastore . openConnection ( ) ; getDatastoreConnections ( ) . add ( dataContextProvider ) ; }
Initializes a DatastoreConnection which will keep the connection open
19,059
public static ClassLoader getParentClassLoader ( ) { logger . debug ( "getParentClassLoader() invoked, web start mode: {}" , IS_WEB_START ) ; if ( IS_WEB_START ) { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } else { return ClassLoaderUtils . class . getClassLoader ( ) ; } }
Gets an appropriate classloader for usage when performing classpath lookups and scanning .
19,060
protected Crosstab < Serializable > createMasterCrosstab ( Collection < ? extends R > results ) { final R firstResult = results . iterator ( ) . next ( ) ; final Crosstab < ? > firstCrosstab = firstResult . getCrosstab ( ) ; final Class < ? > valueClass = firstCrosstab . getValueClass ( ) ; final CrosstabDimension dime...
Builds the master crosstab including all dimensions and categories that will be included in the final result .
19,061
public void startFragment ( Fragment fragment , String tag , boolean canAddToBackstack ) { FragmentTransaction transaction = getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . fragmentContainer , fragment ) ; if ( canAddToBackstack ) { transaction . addToBackStack ( tag ) ; } transaction . commit...
Start given Fragment
19,062
public void calculateFuzzySpace ( ) { double start = getFrom ( ) . doubleValue ( ) ; double stop = getTo ( ) . doubleValue ( ) ; double step = getStep ( ) . doubleValue ( ) ; members ( ) . forEach ( member -> { if ( member . haveFunctionCall ( ) ) { for ( double i = start ; i <= stop ; i += step ) { member . calculateF...
Calculate the full fuzzy space for this variable .
19,063
static void accessFailed ( ) throws Throwable { String controllerClassName = getControllerClass ( ) . getName ( ) ; Logger . debug ( "Deadbolt: Access failure on [%s]" , controllerClassName ) ; String responseFormat = null ; if ( getActionAnnotation ( JSON . class ) != null ) { responseFormat = "json" ; } else if ( get...
Generic access failure forwarding point .
19,064
public static boolean hasAllRoles ( RoleHolder roleHolder , String [ ] roleNames ) { boolean hasRole = false ; if ( roleHolder != null ) { List < ? extends Role > roles = roleHolder . getRoles ( ) ; if ( roles != null ) { List < String > heldRoles = new ArrayList < String > ( ) ; for ( Role role : roles ) { if ( role !...
Checks if the current user has all of the specified roles .
19,065
public static boolean hasRoles ( List < String > roleNames ) throws Throwable { DEADBOLT_HANDLER . beforeRoleCheck ( ) ; RoleHolder roleHolder = getRoleHolder ( ) ; return roleHolder != null && roleHolder . getRoles ( ) != null && hasAllRoles ( roleHolder , roleNames . toArray ( new String [ roleNames . size ( ) ] ) ) ...
Checks if the current user has the specified role .
19,066
public void put ( E value , boolean createCategories ) throws IllegalArgumentException , NullPointerException { if ( createCategories ) { for ( int i = 0 ; i < categories . length ; i ++ ) { String category = categories [ i ] ; CrosstabDimension dimension = crosstab . getDimension ( i ) ; dimension . addCategory ( cate...
Puts the given value to the navigated position in the crosstab .
19,067
protected String getHeaderValue ( HtmlRenderingContext context , int col , String columnName ) { return context . escapeHtml ( columnName ) ; }
Overrideable method for defining the literal HTML table header of a particular column .
19,068
public final String asWhereConditionWithParam ( ) { if ( table == null ) { return column + operator + ":" + column ; } return table + "." + column + operator + ":" + column ; }
Returns the where condition with a parameter .
19,069
public static List < RowProcessingConsumer > sortConsumers ( List < RowProcessingConsumer > consumers ) { final RowProcessingConsumerSorter sorter = new RowProcessingConsumerSorter ( consumers ) ; final List < RowProcessingConsumer > sortedConsumers = sorter . createProcessOrderedConsumerList ( ) ; if ( logger . isDebu...
Sorts a list of consumers into their execution order
19,070
public void processRows ( RowProcessingMetrics rowProcessingMetrics ) { final RowProcessingQueryOptimizer queryOptimizer = getQueryOptimizer ( ) ; final Query finalQuery = queryOptimizer . getOptimizedQuery ( ) ; final RowIdGenerator idGenerator ; if ( finalQuery . getFirstRow ( ) == null ) { idGenerator = new SimpleRo...
Fires the actual row processing . This method assumes that consumers have been initialized and the publisher is ready to start processing .
19,071
public AbstractDatastoreType createPojoDatastore ( final Datastore datastore , final Set < Column > columns , final int maxRowsToQuery ) { final PojoDatastoreType datastoreType = new PojoDatastoreType ( ) ; datastoreType . setName ( datastore . getName ( ) ) ; datastoreType . setDescription ( datastore . getDescription...
Creates a serialized POJO copy of a datastore .
19,072
public static Data valueOf ( final String type , final Object obj ) { return new Data ( type , mimeType ( obj ) , content ( obj ) ) ; }
Creates a new instance from a given object .
19,073
public void run ( R row , String value , int distinctCount ) { final List < Token > tokens ; boolean match = false ; try { tokens = _tokenizer . tokenize ( value ) ; } catch ( RuntimeException e ) { throw new IllegalStateException ( "Error occurred while tokenizing value: " + value , e ) ; } final String patternCode = ...
This method should be invoked by the user of the PatternFinder . Invoke it for each value in your dataset . Repeated values are handled correctly but if available it is more effecient to handle only the distinct values and their corresponding distinct counts .
19,074
public String map ( String name ) { String mapped = super . get ( name ) ; if ( mapped == null ) { mapped = String . format ( "%s%03d" , BASENAME , count . incrementAndGet ( ) ) ; super . put ( name , mapped ) ; } return mapped ; }
Map a variable name
19,075
public static KAFDocument createFromFile ( File file ) throws IOException { KAFDocument kaf = null ; try { kaf = ReadWriteManager . load ( file ) ; } catch ( JDOMException e ) { e . printStackTrace ( ) ; } return kaf ; }
Creates a new KAFDocument and loads the contents of the file passed as argument
19,076
public static KAFDocument createFromStream ( Reader stream ) throws IOException , JDOMException { KAFDocument kaf = null ; kaf = ReadWriteManager . load ( stream ) ; return kaf ; }
Creates a new KAFDocument loading the content read from the reader given on argument .
19,077
public LinguisticProcessor addLinguisticProcessor ( String layer , String name ) { LinguisticProcessor lp = new LinguisticProcessor ( name , layer ) ; List < LinguisticProcessor > layerLps = lps . get ( layer ) ; if ( layerLps == null ) { layerLps = new ArrayList < LinguisticProcessor > ( ) ; lps . put ( layer , layerL...
Adds a linguistic processor to the document header . The timestamp is added implicitly .
19,078
public boolean linguisticProcessorExists ( String layer , String name , String version ) { List < LinguisticProcessor > layerLPs = lps . get ( layer ) ; if ( layerLPs == null ) { return false ; } for ( LinguisticProcessor lp : layerLPs ) { if ( lp . version == null ) { return false ; } else if ( lp . name . equals ( na...
Returns wether the given linguistic processor is already defined or not . Both name and version must be exactly the same .
19,079
public Term newTerm ( String id , Span < WF > span ) { idManager . updateCounter ( AnnotationType . TERM , id ) ; Term newTerm = new Term ( id , span , false ) ; annotationContainer . add ( newTerm , Layer . TERMS , AnnotationType . TERM ) ; addToWfTermIndex ( newTerm . getSpan ( ) . getTargets ( ) , newTerm ) ; return...
Creates a Term object to load an existing term . It receives the ID as an argument . The Term is added to the document object .
19,080
public Dep newDep ( Term from , Term to , String rfunc ) { Dep newDep = new Dep ( from , to , rfunc ) ; annotationContainer . add ( newDep , Layer . DEPS , AnnotationType . DEP ) ; return newDep ; }
Creates a new dependency . The Dep is added to the document object .
19,081
public Chunk newChunk ( String id , String phrase , Span < Term > span ) { idManager . updateCounter ( AnnotationType . CHUNK , id ) ; Chunk newChunk = new Chunk ( id , span ) ; newChunk . setPhrase ( phrase ) ; annotationContainer . add ( newChunk , Layer . CHUNKS , AnnotationType . CHUNK ) ; return newChunk ; }
Creates a chunk object to load an existing chunk . It receives it s ID as an argument . The Chunk is added to the document object .
19,082
public Chunk newChunk ( String phrase , Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . CHUNK ) ; Chunk newChunk = new Chunk ( newId , span ) ; newChunk . setPhrase ( phrase ) ; annotationContainer . add ( newChunk , Layer . CHUNKS , AnnotationType . CHUNK ) ; return newChunk ; }
Creates a new chunk . It assigns an appropriate ID to it . The Chunk is added to the document object .
19,083
public Entity newEntity ( String id , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . ENTITY , id ) ; Entity newEntity = new Entity ( id , references ) ; annotationContainer . add ( newEntity , Layer . ENTITIES , AnnotationType . ENTITY ) ; return newEntity ; }
Creates an Entity object to load an existing entity . It receives the ID as an argument . The entity is added to the document object .
19,084
public Entity newEntity ( List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . ENTITY ) ; Entity newEntity = new Entity ( newId , references ) ; annotationContainer . add ( newEntity , Layer . ENTITIES , AnnotationType . ENTITY ) ; return newEntity ; }
Creates a new Entity . It assigns an appropriate ID to it . The entity is added to the document object .
19,085
public Coref newCoref ( String id , List < Span < Term > > mentions ) { idManager . updateCounter ( AnnotationType . COREF , id ) ; Coref newCoref = new Coref ( id , mentions ) ; annotationContainer . add ( newCoref , Layer . COREFERENCES , AnnotationType . COREF ) ; return newCoref ; }
Creates a coreference object to load an existing Coref . It receives it s ID as an argument . The Coref is added to the document .
19,086
public Coref newCoref ( List < Span < Term > > mentions ) { String newId = idManager . getNextId ( AnnotationType . COREF ) ; Coref newCoref = new Coref ( newId , mentions ) ; annotationContainer . add ( newCoref , Layer . COREFERENCES , AnnotationType . COREF ) ; return newCoref ; }
Creates a new coreference . It assigns an appropriate ID to it . The Coref is added to the document .
19,087
public Timex3 newTimex3 ( String id , String type ) { idManager . updateCounter ( AnnotationType . TIMEX3 , id ) ; Timex3 newTimex3 = new Timex3 ( id , type ) ; annotationContainer . add ( newTimex3 , Layer . TIME_EXPRESSIONS , AnnotationType . TIMEX3 ) ; return newTimex3 ; }
Creates a timeExpressions object to load an existing Timex3 . It receives it s ID as an argument . The Timex3 is added to the document .
19,088
public Timex3 newTimex3 ( String type ) { String newId = idManager . getNextId ( AnnotationType . TIMEX3 ) ; Timex3 newTimex3 = new Timex3 ( newId , type ) ; annotationContainer . add ( newTimex3 , Layer . TIME_EXPRESSIONS , AnnotationType . TIMEX3 ) ; return newTimex3 ; }
Creates a new timeExpressions . It assigns an appropriate ID to it . The Coref is added to the document .
19,089
public Factvalue newFactvalue ( WF wf , String prediction ) { Factvalue factuality = new Factvalue ( wf , prediction ) ; annotationContainer . add ( factuality , Layer . FACTUALITY_LAYER , AnnotationType . FACTVALUE ) ; return factuality ; }
Creates a factualitylayer object and add it to the document
19,090
public Feature newProperty ( String id , String lemma , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . PROPERTY , id ) ; Feature newProperty = new Feature ( id , lemma , references ) ; annotationContainer . add ( newProperty , Layer . PROPERTIES , AnnotationType . PROPERTY ) ; return...
Creates a new property . It receives it s ID as an argument . The property is added to the document .
19,091
public Feature newProperty ( String lemma , List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . PROPERTY ) ; Feature newProperty = new Feature ( newId , lemma , references ) ; annotationContainer . add ( newProperty , Layer . PROPERTIES , AnnotationType . PROPERTY ) ; return ne...
Creates a new property . It assigns an appropriate ID to it . The property is added to the document .
19,092
public Feature newCategory ( String id , String lemma , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . CATEGORY , id ) ; Feature newCategory = new Feature ( id , lemma , references ) ; annotationContainer . add ( newCategory , Layer . CATEGORIES , AnnotationType . CATEGORY ) ; return...
Creates a new category . It receives it s ID as an argument . The category is added to the document .
19,093
public Feature newCategory ( String lemma , List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . CATEGORY ) ; Feature newCategory = new Feature ( newId , lemma , references ) ; annotationContainer . add ( newCategory , Layer . CATEGORIES , AnnotationType . CATEGORY ) ; return ne...
Creates a new category . It assigns an appropriate ID to it . The category is added to the document .
19,094
public Opinion newOpinion ( ) { String newId = idManager . getNextId ( AnnotationType . OPINION ) ; Opinion newOpinion = new Opinion ( newId ) ; annotationContainer . add ( newOpinion , Layer . OPINIONS , AnnotationType . OPINION ) ; return newOpinion ; }
Creates a new opinion object . It assigns an appropriate ID to it . The opinion is added to the document .
19,095
public Opinion newOpinion ( String id ) { idManager . updateCounter ( AnnotationType . OPINION , id ) ; Opinion newOpinion = new Opinion ( id ) ; annotationContainer . add ( newOpinion , Layer . OPINIONS , AnnotationType . OPINION ) ; return newOpinion ; }
Creates a new opinion object . It receives its ID as an argument . The opinion is added to the document .
19,096
public Predicate newPredicate ( String id , Span < Term > span ) { idManager . updateCounter ( AnnotationType . PREDICATE , id ) ; Predicate newPredicate = new Predicate ( id , span ) ; annotationContainer . add ( newPredicate , Layer . SRL , AnnotationType . PREDICATE ) ; return newPredicate ; }
Creates a new srl predicate . It receives its ID as an argument . The predicate is added to the document .
19,097
public Predicate newPredicate ( Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . PREDICATE ) ; Predicate newPredicate = new Predicate ( newId , span ) ; annotationContainer . add ( newPredicate , Layer . SRL , AnnotationType . PREDICATE ) ; return newPredicate ; }
Creates a new srl predicate . It assigns an appropriate ID to it . The predicate is added to the document .
19,098
public Predicate . Role newRole ( String id , Predicate predicate , String semRole , Span < Term > span ) { idManager . updateCounter ( AnnotationType . ROLE , id ) ; Predicate . Role newRole = new Predicate . Role ( id , semRole , span ) ; return newRole ; }
Creates a Role object to load an existing role . It receives the ID as an argument . It doesn t add the role to the predicate .
19,099
public Predicate . Role newRole ( Predicate predicate , String semRole , Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . ROLE ) ; Predicate . Role newRole = new Predicate . Role ( newId , semRole , span ) ; return newRole ; }
Creates a new Role object . It assigns an appropriate ID to it . It uses the ID of the predicate to create a new ID for the role . It doesn t add the role to the predicate .