code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@Bean public ReplayingCluster replayCluster(){
IncomingMessageHandler incomingMessageHandler=new DiscardingIncomingMessageHandler();
EventStoreManagement eventStore=(EventStoreManagement)jdbcEventStore();
return new ReplayingCluster(replay(),eventStore,new NoTransactionManager(),0,incomingMessageHandler);
}
| Takes the #replay() cluster and wraps it with a Replaying Cluser, turning the event handlers that are registered to be able to pick up events when events are replayed. |
public <T>void addFactory(Class<T> type,T red,T black){
factoryCache.put(type,new SimpleFactory<>(red,black));
}
| Associates the specified values with the specified class. |
private static RsrcIfc checkRsrc(ServiceContext context,long currentTime,String path,String validUrl,Class replacerCls,TempRsrc[] rsrcsToLoad,BackThreadLoadInfo backThreadLoadInfo,LoadLock rsrcLoadLock,LoadLock rsrcWaitLock,boolean isInIEComment){
boolean isStateFull=context.isStateFull;
boolean isRefreshRequest=co... | Checks if the resource whos url is path is found in cache. When found it is assigned to rsrcs[r]. When not found A TempRsrc is assigned to rsrcs[r]. |
void clearSubNodes(){
mSubNodes=null;
}
| Clears node sub-nodes (childs). |
<K,V>Collection<CacheEntryEvent<? extends K,? extends V>> collectEntries(CacheContinuousQueryEntry entry,GridCacheContext cctx,IgniteCache cache){
assert entry != null;
if (entry.topologyVersion() == null) {
assert entry.updateCounter() == 0L : entry;
return F.<CacheEntryEvent<? extends K,? extends V>>asLis... | Add continuous entry. |
private void teardownSpringServlets(){
wc.unregisterServlet(dispatcherServlet);
wc.unregisterServlet(contextLoaderServlet);
}
| Unregisters the Spring servlets which effectively stops the verinice server. |
public static void instanceListToArffFile(File outputFile,FeatureStore instanceList) throws Exception {
instanceListToArffFile(outputFile,instanceList,false,false);
}
| Converts a feature store to a list of instances. Single-label case. |
private static int determineConsecutiveDigitCount(CharSequence msg,int startpos){
int count=0;
int len=msg.length();
int idx=startpos;
if (idx < len) {
char ch=msg.charAt(idx);
while (isDigit(ch) && idx < len) {
count++;
idx++;
if (idx < len) {
ch=msg.charAt(idx);
}
}... | Determines the number of consecutive characters that are encodable using numeric compaction. |
public QuadEdgeSubdivision(Envelope env,double tolerance){
this.tolerance=tolerance;
edgeCoincidenceTolerance=tolerance / EDGE_COINCIDENCE_TOL_FACTOR;
createFrame(env);
startingEdge=initSubdiv();
locator=new LastFoundQuadEdgeLocator(this);
}
| Creates a new instance of a quad-edge subdivision based on a frame triangle that encloses a supplied bounding box. A new super-bounding box that contains the triangle is computed and stored. |
private void updateStyle(JComponent c){
SeaGlassContext context=getContext(this,ENABLED);
SynthStyle oldStyle=style;
style=SeaGlassLookAndFeel.updateSeaglassStyle(context,this);
if (style != oldStyle) {
titleSpacing=style.getInt(context,"InternalFrameTitlePane.titleSpacing",2);
}
context.dispose();
}
| Update the Synth Style. |
private td createTD(Element element){
td td=new td().addElement(element).setAlign(AlignType.LEFT).setVAlign(AlignType.TOP);
return td;
}
| Create Left Top aligned TD |
public boolean writeHeader(OutputStream os){
try {
writeInt(os,CACHE_MAGIC);
writeString(os,key);
writeString(os,etag == null ? "" : etag);
writeLong(os,serverDate);
writeLong(os,lastModified);
writeLong(os,ttl);
writeLong(os,softTtl);
writeStringStringMap(responseHeaders,os);
os.f... | Writes the contents of this CacheHeader to the specified OutputStream. |
public void process() throws Exception {
String argInputFile=argValues.getFirstResult(ARG_WEB_XML_FILE);
ByteArrayOutputStream output=new ByteArrayOutputStream();
InputStream input=new FileInputStream(argInputFile);
processWebXml(input,output);
input.close();
System.out.println(output.toString());
}
| The main entry point for processing |
private BatchTrainScore constructDetector() throws ConfigurationException {
return conf.constructTransform();
}
| Every context stores its own detector |
public boolean equals3D(Coordinate other){
return (x == other.x) && (y == other.y) && ((z == other.z) || (Double.isNaN(z) && Double.isNaN(other.z)));
}
| Tests if another coordinate has the same values for the X, Y and Z ordinates. |
public DimensionsDescriptor(String aggregationString){
initialize(aggregationString);
}
| This construction creates a dimensions descriptor (dimensions combination) from the given aggregation string. |
public boolean canPace(){
return false;
}
| Returns whether two values of this type can have their distance computed, as needed by paced animation. |
protected Integer wrapKey(int k){
return new Integer(k);
}
| Wraps a key |
public static void sortByTypeIdIndex(AnnotationItem[] array){
Arrays.sort(array,TYPE_ID_SORTER);
}
| Sorts an array of instances, in place, by type id index, ignoring all other aspects of the elements. This is only valid to use after type id indices are known. |
public void initImpl() throws ConfigException {
if (_handler != null) {
}
else if (_pathHandler != null) {
}
else {
setPath(Paths.get("."));
}
if (_formatter != null) {
}
else if (_handler != null && _handler.getFormatter() != null) {
}
else {
_formatter=new PatternFormatter(PatternFormatt... | Should be run with system classloader |
private void applyGrouping(){
cachedGroupCellToDataTableMap=new HashMap<GroupCellKey,DataTable>();
Vector<PlotDimension> dimensionList=new Vector<PlotDimension>();
dimensionList.addAll(plotInstance.getCurrentPlotConfigurationClone().getDefaultDimensionConfigs().keySet());
dimensionList.add(PlotDimension.DOMAIN)... | Fills cachedGroupCellToDataTableMap, i.e. a data structure which contains a (view on) a DataTable for each group cell. This function is basically just a wrapper for the first call of the recursive createGroupCellData() function. |
protected void resolveDuplicates(SourceRefElement handle){
int occurenceCount=this.occurenceCounts.get(handle);
if (occurenceCount == -1) this.occurenceCounts.put(handle,1);
else {
this.occurenceCounts.put(handle,++occurenceCount);
handle.occurrenceCount=occurenceCount;
}
if (handle instanceof Source... | Resolves duplicate handles by incrementing the occurrence count of the handle being created. |
public boolean accept(File file){
return file.isDirectory() || file.getName().endsWith(".tet");
}
| Accepts a file if its name ends with ".tet". |
public static Uri add(ContentResolver cr,Intent intent,String title,String folder,char shortcut,int ordering){
if (shortcut != 0) {
cr.delete(CONTENT_URI,sShortcutSelection,new String[]{String.valueOf((int)shortcut)});
}
ContentValues values=new ContentValues();
if (title != null) values.put(TITLE,title);... | Add a new bookmark to the system. |
@Override protected boolean request(final long size,final boolean force,AtomicBoolean shortStatus){
if (size <= 0) return true;
final boolean r=request0(size,force);
shortStatus.set(!r);
return r;
}
| <p>Tries to free a specified amount of bytes.</p> <p> If the currently available memory is enough, the method returns <code>true</code> without performing additional steps. If not, the behaviour depends on the parameter <code>force</code>. If <code>false</code>, a Full GC is only performed if former GCs indicated that ... |
protected SheetCollate(int value){
super(value);
}
| Construct a new sheet collate enumeration value with the given integer value. |
public T caseState(State object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>State</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
private void migrateOldPreferences(SharedPreferences prefs){
mVibrate.setChecked(Utils.getDefaultVibrate(getActivity(),prefs));
if (!prefs.contains(KEY_ALERTS) && prefs.contains(KEY_ALERTS_TYPE)) {
String type=prefs.getString(KEY_ALERTS_TYPE,ALERT_TYPE_STATUS_BAR);
if (type.equals(ALERT_TYPE_OFF)) {
m... | If necessary, upgrades previous versions of preferences to the current set of keys and values. |
public boolean isResolvedTypeInferredFromExpectedType(){
return this.ast.getBindingResolver().isResolvedTypeInferredFromExpectedType(this);
}
| Returns true if the resolved return type has been inferred from the assignment context (JLS3 15.12.2.8), false otherwise. <p> This information is available only when bindings are requested when the AST is being built </p> . |
public void submit(){
if (edited) {
setValue(newValue(valField.getText()));
}
}
| Commits to the current setting of the propertyField, filtering it through newValue. |
public boolean isLoad(){
return (this.opDetails & (OP_DETAILS_LOCAL_LOAD | OP_DETAILS_NET_LOAD)) != 0;
}
| Returns true if this operation included running a loader. |
public boolean hasFailed(){
return "store_response_failure".equals(_parameters.getParameterValue("mode"));
}
| Returns true if the Store Response is a failure message, true if it is a success response. |
protected void sendMomentaryFunctionGroup3(){
DCCppMessage msg=DCCppMessage.makeFunctionGroup2SetMomMsg(this.getDccAddress(),f9Momentary,f10Momentary,f11Momentary,f12Momentary);
queueMessage(msg,THROTTLEIDLE);
}
| Send the DCC++ message to set the momentary state of functions F9, F10, F11, F12 |
public static String postFixForDigits(long args){
long[] numbers=new long[]{args};
long numb=0;
for ( long number : numbers) {
numb=number;
}
return format(numb);
}
| add post fix to any long digit like 10k for 10000 |
private void writeWaypoints(final BufferedWriter bw) throws IOException {
Log.i(TAG,"Writing trackpoints");
Cursor c=mDbHelper.getReadableDatabase().rawQuery(WAYPOINT_SQL_QUERY,new String[]{String.valueOf(mSession),String.valueOf(0)});
final int colLatitude=c.getColumnIndex(Schema.COL_LATITUDE);
final int colLo... | Iterates on track points and write them. |
public DrawerBuilder withAdapter(@NonNull BaseDrawerAdapter adapter){
if (mAdapter != null) {
throw new RuntimeException("the adapter was already set or items were added to it. A header is also a RecyclerItem");
}
this.mAdapter=adapter;
return this;
}
| Define a custom Adapter which will be used in the drawer NOTE: this is not recommended |
public void scan(String originalXml){
Matcher matcher=INSTRUCTION_PATTERN.matcher(originalXml);
while (matcher.find()) {
scanOneInstruction(matcher.group(1));
containsIgnoredSections=true;
}
if (expectedNextInstruction != IGNORE) {
addError(String.format("Xml processing instructions for sortpom was ... | Scan and verifies the pom file for processing instructions |
public void clearNotifications(){
mNotificationManager.cancel(AppConstants.NOTIFICATION_ID_WALL);
}
| Cancels any notifications being displayed. Call this if the relevant screen is opened within the app |
public boolean isImageDefined(){
return imageDefined;
}
| Checks whether an image has been defined for this organization. |
public TileEntityContainerBlock(String name){
fullName=name;
}
| A simple tile entity with a container and facing state. |
@Override public void run(){
amIActive=true;
String inputFile=args[0];
if (inputFile.toLowerCase().contains(".dep")) {
calculateRaster();
}
else if (inputFile.toLowerCase().contains(".shp")) {
calculateVector();
}
else {
showFeedback("There was a problem reading the input file.");
}
}
| Used to execute this plugin tool. |
LayoutFocusTraversalPolicy(Comparator<? super Component> c){
super(c);
}
| Constructs a LayoutFocusTraversalPolicy with the passed in <code>Comparator</code>. |
public static DoubleMatrix2D plusMult(DoubleMatrix2D A,DoubleMatrix2D B,double s){
return A.assign(B,F.plusMult(s));
}
| <tt>A = A + B*s <=> A[row,col] = A[row,col] + B[row,col]*s</tt>. |
public void shouldThrowWhenInterruptedDuringSynchronousDelay() throws Throwable {
Thread mainThread=Thread.currentThread();
new Thread(null).start();
try {
Failsafe.with(new RetryPolicy().withDelay(5,TimeUnit.SECONDS)).run(null);
}
catch ( Exception e) {
assertTrue(e instanceof FailsafeException);
... | Asserts that Failsafe throws when interrupting a waiting thread. |
public boolean isStrategyWorkerRunning(final Tradestrategy tradestrategy){
String key=tradestrategy.getStrategy().getClassName() + tradestrategy.getIdTradeStrategy();
if (isStrategyWorkerRunning(key)) {
return true;
}
if (tradestrategy.getStrategy().hasStrategyManager()) {
key=tradestrategy.getStrategy(... | Method isStrategyWorkerRunning. |
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
if (resultCode != RESULT_OK) {
return;
}
switch (requestCode) {
case REQUEST_CODE_CHANNELS:
channels=data.getExtras().getStringArrayList(Extra.CHANNELS);
break;
case REQUEST_CODE_COMMANDS:
commands=data.getExtras().getS... | On activity result |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
@CanIgnoreReturnValue public MapMaker concurrencyLevel(int concurrencyLevel){
checkState(this.concurrencyLevel == UNSET_INT,"concurrency level was already set to %s",this.concurrencyLevel);
checkArgument(concurrencyLevel > 0);
this.concurrencyLevel=concurrencyLevel;
return this;
}
| Guides the allowed concurrency among update operations. Used as a hint for internal sizing. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention. Because assignment of entries to these partitions is not necessarily uniform, the actual concurrency observed ma... |
public void reportPublicApi(ClassSymbol sym){
}
| Report the public api of a class that was supplied explicitly for compilation, for example on the command line to javac. |
public static void putAt(StringBuffer self,EmptyRange range,Object value){
RangeInfo info=subListBorders(self.length(),range);
self.replace(info.from,info.to,value.toString());
}
| Support the range subscript operator for StringBuffer. |
public Map<Context,List<OutlierClassificationResult>> searchContextualOutliers(List<ContextualDatum> data) throws Exception {
Stopwatch sw=Stopwatch.createUnstarted();
log.debug("Find global context outliers on data num tuples: {} , MBs {} ",data.size());
sw.start();
HashSet<ContextualDatum> sample=randomSampli... | Interface 1: search all contextual outliers |
UnknownAction(){
suggestions=null;
}
| Create an UnknownAction with no suggestions for commands. |
public ReliefF(int featureCount,final int m,final int n,final DistanceMetric dm,VectorCollectionFactory<Vec> vcf){
super();
setFeatureCount(featureCount);
setIterations(m);
setNeighbors(n);
setDistanceMetric(dm);
this.vcf=vcf;
}
| Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation |
public static Object encrypt(Object value){
if (value instanceof String) return encrypt((String)value);
return value;
}
| Encryption. The methods must recognize clear values |
public void undoableEditHappened(UndoableEditEvent e){
addEdit(e.getEdit());
}
| An <code>UndoableEditListener</code> method. This invokes <code>addEdit</code> with <code>e.getEdit()</code>. |
public static long increment(long serial){
if (serial < 0 || serial > MAX32) throw new IllegalArgumentException(serial + " out of range");
if (serial == MAX32) return 0;
return serial + 1;
}
| Increments a serial number. The number is assumed to be a 32 bit unsigned integer stored in a long. This basically adds 1 and resets the value to 0 if it is 2^32. |
public void updateSizes(@ProgressDrawableSize int size){
if (size == LARGE) {
setSizeParameters(CIRCLE_DIAMETER_LARGE,CIRCLE_DIAMETER_LARGE,CENTER_RADIUS_LARGE,STROKE_WIDTH_LARGE,ARROW_WIDTH_LARGE,ARROW_HEIGHT_LARGE);
}
else {
setSizeParameters(CIRCLE_DIAMETER,CIRCLE_DIAMETER,CENTER_RADIUS,STROKE_WIDTH,ARR... | Set the overall size for the progress spinner. This updates the radius and stroke width of the ring. |
public void addSetting(final Pair<ISetting<?>,ISettingsBean> setting){
if (settingList == null) settingList=new ArrayList<>();
settingList.add(setting);
}
| Adds a setting to this page. |
private String rewriteExpressionToGlobalScope(ExpressionAST expr,Space root) throws ScopeException {
IDomain source=expr.getSourceDomain();
if (!source.isInstanceOf(DomainDomain.DOMAIN)) {
String global=root.prettyPrint();
String value=expr.prettyPrint();
return global + ".(" + value+ ")";
}
else {
... | rewrite a local expression valid in the root scope as a global expression |
private void unregisterCallback(){
if (DBG) Log.d(TAG,"unregisterCallback() - mServerIf=" + mServerIf);
if (mService == null || mServerIf == 0) return;
try {
mCallback=null;
mService.unregisterServer(mServerIf);
mServerIf=0;
}
catch ( RemoteException e) {
Log.e(TAG,"",e);
}
}
| Unregister the current application and callbacks. |
public synchronized boolean canUndoOrRedo(){
if (indexOfNextAdd == edits.size()) {
return canUndo();
}
else {
return canRedo();
}
}
| Returns true if it is possible to invoke <code>undo</code> or <code>redo</code>. |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName,attValue);
}
else {
registerPrefix(xmlWriter,namesp... | Util method to write an attribute without the ns prefix |
public void load(String dctFileRoot){
String dctFilePath=dctFileRoot + "/coredict.dct";
Path serialObj=Paths.get(dctFileRoot + "/coredict.mem");
if (Files.exists(serialObj) && loadFromObj(serialObj)) {
}
else {
try {
wordIndexTable=new short[PRIME_INDEX_LENGTH];
charIndexTable=new char[PRIME_IN... | Attempt to load dictionary from provided directory, first trying coredict.mem, failing back on coredict.dct |
public static void removeSelectedNodes(final ZyGraph graph){
Preconditions.checkNotNull(graph,"IE01732: Graph argument can not be null");
final List<NaviNode> selectedNodes=filterHiddenNodes(graph.getSelectedNodes());
graph.deleteNodes(selectedNodes);
}
| Removes the selected nodes from the graph. |
public void resumeEncoding(){
this.suspendEncoding=false;
}
| Resumes encoding of the stream. May be helpful if you need to embed a piece of base64-encoded data in a stream. |
protected static Plane createHessePlane(Vector3 p0,Vector3 p1,Vector3 p2){
Vector3 a=p1.clone().subtract(p0);
Vector3 b=p2.clone().subtract(p0);
Vector3 normal=a.cross(b);
normal.normalize();
Vector3 scale=p0.clone().multiply(normal);
double distance=scale.x + scale.y + scale.z;
return new Plane(normal,di... | create Hesse Normal Plane from 3 points |
public PercolateRequest routing(String routing){
this.routing=routing;
return this;
}
| A comma separated list of routing values to control the shards the search will be executed on. |
public StretchedVertex(Coordinate vertexPt,Coordinate[] parentLine,int parentIndex,Coordinate nearPt,Coordinate[] nearPts,int nearIndex){
this.vertexPt=vertexPt;
this.parentLine=parentLine;
this.parentIndex=parentIndex;
this.nearPt=nearPt;
this.nearPts=nearPts;
this.nearIndex=nearIndex;
}
| Creates a vertex which lies near a vertex |
public SolrInputField removeField(String name){
return _fields.remove(name);
}
| Remove a field from the document |
public void testProcedureColumns() throws Exception {
try {
Statement stmt=con.createStatement();
stmt.execute("CREATE PROC jtds_testparam @p1 int, @p2 int output as\r\n" + "BEGIN\r\n" + " SELECT @p2 = @p1\r\n"+ "END");
stmt.close();
DatabaseMetaData dbmd=con.getMetaData();
String[] columnPattern... | Test for bug [1184376] Sybase getProcedureColumns bug |
private boolean accept(SocketBar socket){
PortTcp port=port();
try {
while (!port().isClosed()) {
if (_serverSocket.accept(socket)) {
if (port.isClosed()) {
socket.close();
return false;
}
else if (isThrottle()) {
socket.close();
}
else {
... | Accepts a new connection. |
public float bearingTo(Location dest){
synchronized (mResults) {
if (mLatitude != mLat1 || mLongitude != mLon1 || dest.mLatitude != mLat2 || dest.mLongitude != mLon2) {
computeDistanceAndBearing(mLatitude,mLongitude,dest.mLatitude,dest.mLongitude,mResults);
mLat1=mLatitude;
mLon1=mLongitude;
... | Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between this location and the given location. The shortest path is defined using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless results. |
KrbApReq(APOptions apOptions,Ticket ticket,EncryptionKey key,PrincipalName cname,Checksum cksum,KerberosTime ctime,EncryptionKey subKey,SeqNumber seqNumber,AuthorizationData authorizationData) throws Asn1Exception, IOException, KdcErrException, KrbCryptoException {
init(apOptions,ticket,key,cname,cksum,ctime,subKey,s... | used by KrbTgsReq |
public boolean isContaining(String include){
if (value == null) {
return false;
}
if (splits == null) {
splits=StringUtil.splitc(value,' ');
}
for ( String s : splits) {
if (s.equals(include)) {
return true;
}
}
return false;
}
| Returns true if attribute is containing some value. |
public boolean add(AbstractPlugin plugin){
return plugins.add(plugin);
}
| Add a plugin to the container |
public void dynamicDisplay(int col){
if (!gridTab.isOpen()) {
return;
}
if (col > 0) return;
boolean noData=gridTab.getRowCount() == 0;
List<WEditor> list=renderer.getEditors();
for ( WEditor comp : list) {
GridField mField=comp.getGridField();
if (mField != null && mField.getIncluded_Tab_ID(... | validate the display properties of fields of current row |
public void startElement(String uri,String localName,String qName,Attributes attributes) throws org.xml.sax.SAXException {
if (qName.equals(PrintData.XML_TAG)) {
String name=attributes.getValue(PrintData.XML_ATTRIBUTE_NAME);
if (m_pd == null) {
m_pd=new PrintData(m_ctx,name);
push(m_pd);
}
el... | Receive notification of the start of an element. |
public static byte[] decode(byte[] source) throws Base64DecoderException {
return decode(source,0,source.length);
}
| Decodes Base64 content in byte array format and returns the decoded byte array. |
public final double radian(Coords d){
final IdealHex src=IdealHex.get(this);
final IdealHex dst=IdealHex.get(d);
if (src.cy == dst.cy) {
return (src.cx < dst.cx) ? Math.PI / 2 : Math.PI * 1.5;
}
double r=Math.atan((dst.cx - src.cx) / (src.cy - dst.cy));
if (src.cy < dst.cy) {
r=(r + Math.PI) % (Math... | Returns the radian direction of another Coords. |
public void testInit(){
System.out.println("init");
mockInitialisationCalls(true,AuditStatus.CONTENT_LOADING);
getInstance();
setVerifyMode();
}
| Test of init method, of class UploadAuditCommandImpl. |
protected void addToChildren(ZipEntry parent,ZipEntry child){
List childList=(List)children.get(parent);
if (childList == null) {
childList=new ArrayList();
children.put(parent,childList);
}
childList.add(child);
}
| Adds the specified child to the internal collection of the parent's children. |
@Override public boolean addAll(Collection<? extends E> c){
Iterator<? extends E> i=c.iterator();
boolean changed=false;
while (i.hasNext()) {
boolean ret=add(i.next());
if (!changed) {
changed=ret;
}
}
return changed;
}
| Add all of the elements in the given collection to this list. |
protected void addAdditionalActionItems(){
getColumnControlPopup().addAdditionalActionItems(Collections.unmodifiableList(getAdditionalActions()));
}
| Adds additional actions to the popup. Here: delegates the list of actions as returned by #getAdditionalActions() to the DefaultColumnControlPopup. Does nothing if #getColumnActions() is empty. |
@Override public boolean add(Object element){
if (isFull()) {
remove();
}
return super.add(element);
}
| If the buffer is full, the least recently added element is discarded so that a new element can be inserted. |
public static boolean isPrimitiveDatatype(IRI datatype){
return datatype.equals(XMLSchema.DURATION) || datatype.equals(XMLSchema.DATETIME) || datatype.equals(XMLSchema.TIME)|| datatype.equals(XMLSchema.DATE)|| datatype.equals(XMLSchema.GYEARMONTH)|| datatype.equals(XMLSchema.GYEAR)|| datatype.equals(XMLSchema.GMONTHD... | Checks whether the supplied datatype is a primitive XML Schema datatype. |
public static IStatus validateJavaTypeName(String name){
return validateJavaTypeName(name,org.eclipse.jdt.core.JavaCore.VERSION_1_3,org.eclipse.jdt.core.JavaCore.VERSION_1_3);
}
| Validate the given Java type name, either simple or qualified. For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>. <p> |
public static <T>T checkNotNull(T reference,Object errorMessage){
if (reference == null) {
throw new NullPointerException(String.valueOf(errorMessage));
}
return reference;
}
| Ensures that an object reference passed as a parameter to the calling method is not null. |
public final void value(int i,double v){
data[i]=v;
}
| Set the value of the i'th index of the vector. |
public boolean equals(Object o){
if (o == null || !(o instanceof ZipLong)) {
return false;
}
return value == ((ZipLong)o).getValue();
}
| Override to make two instances with same value equal. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static boolean areSame(Collection<? extends AnnotationMirror> c1,Collection<? extends AnnotationMirror> c2){
if (c1.size() != c2.size()) {
return false;
}
if (c1.size() == 1) {
return areSame(c1.iterator().next(),c2.iterator().next());
}
Set<AnnotationMirror> s1=createAnnotationSet();
Set<Ann... | Checks that two collections contain the same annotations. |
public static int writeBEInt(byte[] b,int off,int val){
b[off + 0]=(byte)((val >> 24) & 0xff);
b[off + 1]=(byte)((val >> 16) & 0xff);
b[off + 2]=(byte)((val >> 8) & 0xff);
b[off + 3]=(byte)((val) & 0xff);
return 4;
}
| Writes the given integer to the given buffer at the given location in big endian format. |
public PlatformServices withAsync(){
if (services.isAsync()) return this;
return new PlatformServices(platformCtx,services.withAsync(),srvKeepBinary);
}
| Gets services with asynchronous mode enabled. |
public void insert(int offset,float[] values,int valOffset,int len){
if (offset == _pos) {
add(values,valOffset,len);
return;
}
ensureCapacity(_pos + len);
System.arraycopy(_data,offset,_data,offset + len,_pos - offset);
System.arraycopy(values,valOffset,_data,offset,len);
_pos+=len;
}
| Inserts a slice of the array of <tt>values</tt> into the list at <tt>offset</tt>. All values including and to the right of <tt>offset</tt> are shifted to the right. |
public static final byte composeSmeManualAckRequested(byte registeredDelivery){
return composeSmeAck(registeredDelivery,SMPPConstant.REGDEL_SME_MANUAL_ACK_REQUESTED);
}
| SME originated Acknowledgment. |
public void addValue(IFitsHeader key,double val) throws HeaderCardException {
addValue(key.key(),val,key.comment());
}
| Add or replace a key with the given double value and comment. Note that float values will be promoted to doubles. |
private boolean parseHtmlInline(){
String m=match(HTML_TAG);
if (m != null) {
HtmlInline node=new HtmlInline();
node.setLiteral(m);
appendNode(node);
return true;
}
else {
return false;
}
}
| Attempt to parse inline HTML. |
@Override public void eUnset(int featureID){
switch (featureID) {
case SGenPackage.DEPRECATABLE_ELEMENT__DEPRECATED:
setDeprecated(DEPRECATED_EDEFAULT);
return;
case SGenPackage.DEPRECATABLE_ELEMENT__COMMENT:
setComment(COMMENT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static void init(String propsFilename) throws Exception {
RuntimeSingleton.init(propsFilename);
}
| initialize the Velocity runtime engine, using default properties plus the properties in the properties file passed in as the arg |
public int updateJobDetail(Connection conn,JobDetail job) throws IOException, SQLException {
ByteArrayOutputStream baos=serializeJobData(job.getJobDataMap());
PreparedStatement ps=null;
int insertResult=0;
try {
ps=conn.prepareStatement(rtp(UPDATE_JOB_DETAIL));
ps.setString(1,job.getDescription());
... | <p> Update the job detail record. </p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.