code string | nl string |
|---|---|
private static boolean isPollingPageFar(GraalHotSpotVMConfig config){
final long pollingPageAddress=config.safepointPollingAddress;
return !NumUtil.isSignedNbit(21,pollingPageAddress - config.codeCacheLowBound) || !NumUtil.isSignedNbit(21,pollingPageAddress - config.codeCacheHighBound);
}
| Conservatively checks whether we can load the safepoint polling address with a single ldr instruction or not. |
protected void shiftBuffer(int offset){
fStart=offset;
fEnd=fStart + fBufferSize;
if (fEnd > fDocumentLength) fEnd=fDocumentLength;
try {
String content=fDocument.get(fStart,fEnd - fStart);
content.getChars(0,fEnd - fStart,fBuffer,0);
}
catch ( BadLocationException x) {
}
}
| Shifts the buffer so that the buffer starts at the given document offset. |
public XML addClass(Class<?> aClass,Attribute[] attributes){
checksClassAbsence(aClass);
XmlClass xmlClass=new XmlClass();
xmlClass.name=aClass.getName();
xmlClass.attributes=new ArrayList<XmlAttribute>();
xmlJmapper.classes.add(xmlClass);
addAttributes(aClass,attributes);
return this;
}
| This method adds aClass with the attributes given as input to XML configuration file.<br> It's mandatory define at least one attribute. |
public boolean add(Solution newSolution){
return super.forceAddWithoutCheck(newSolution);
}
| Enables a performance hack to avoid performing non-dominance checks on solutions already known to be non-dominated. |
public Map<Integer,HadoopProcessDescriptor> reducersAddresses(){
return reducersAddrs;
}
| Gets reducers addresses for external execution. |
private void initialiseDrawables(){
leftDrawable=ContextCompat.getDrawable(TestButtonConfig.this,R.drawable.introbutton_behaviour_first);
rightDrawable=ContextCompat.getDrawable(TestButtonConfig.this,R.drawable.introbutton_behaviour_previous);
finalDrawable=ContextCompat.getDrawable(TestButtonConfig.this,R.drawab... | Initialise the drawables to display in the navigation buttons after the appearance/behaviour change is triggered. |
public boolean isLocalName(){
Scope scope=getDefiningScope();
return scope != null && scope.getParentScope() != null;
}
| Return true if this node is known to be defined as a symbol in a lexical scope other than the top-level (global) scope. |
public void configureOption3(String value){
super.configureOption3(value);
log.debug("configureOption3: " + value);
setTurnoutHandling(value);
}
| Set the third port option. Only to be used after construction, but before the openPort call |
private TMember findMemberInSubScope(IScope subScope,String name){
final IEObjectDescription currElem=subScope.getSingleElement(QualifiedName.create(name));
if (currElem != null) {
final EObject objOrProxy=currElem.getEObjectOrProxy();
if (objOrProxy != null && !objOrProxy.eIsProxy() && objOrProxy instanceo... | Searches for a member of the given name and for the given access in the sub-scope with index 'subScopeIdx'. |
public static void main(String[] args){
String[] a=StdIn.readAllStrings();
Knuth.shuffle(a);
for (int i=0; i < a.length; i++) StdOut.println(a[i]);
}
| Reads in a sequence of strings from standard input, shuffles them, and prints out the results. |
public boolean match(TextElement node,Object other){
if (!(other instanceof TextElement)) {
return false;
}
TextElement o=(TextElement)other;
return safeEquals(node.getText(),o.getText());
}
| Returns whether the given node and the other object match. <p> The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed. </p> |
public Builder address(String host,int port){
return address(new InetSocketAddress(host,port));
}
| Sets server address. |
public SerializableInstance(){
super(0);
}
| Instantiates a new serializable instance. |
public boolean isCharged(){
return status == BATTERY_STATUS_FULL || level >= 100;
}
| Whether or not the device is charged. Note that some devices never return 100% for battery level, so this allows either battery level or status to determine if the battery is charged. |
public ECKey maybeDecrypt(@Nullable KeyParameter aesKey) throws KeyCrypterException {
return isEncrypted() && aesKey != null ? decrypt(aesKey) : this;
}
| Creates decrypted private key if needed. |
public String calculateHours(Properties ctx,int WindowNo,GridTab mTab,GridField mField,Object value){
if (isCalloutActive() || value == null) return "";
I_HR_WorkShift workShift=GridTabWrapper.create(mTab,I_HR_WorkShift.class);
Timestamp fromTime=workShift.getShiftFromTime();
Timestamp toTime=workShift.getShi... | Calculates The Number Of Hours Between Given Time |
public static List<TvShowEpisode> parseNFO(MediaFile episodeFile){
List<TvShowEpisode> episodes=new ArrayList<>(1);
episodes.addAll(TvShowEpisodeToXbmcNfoConnector.getData(episodeFile.getFile()));
return episodes;
}
| Parses the nfo. |
public Vector3 normalize(){
return Vector3.normalize(this);
}
| returns the vector with a length of 1 |
public void update(double x_[]){
update(new double[][]{x_});
}
| Update - On raw data (with no bias column) |
public String date(String format,double time){
Calendar d=Calendar.getInstance();
d.setTime(new Date((long)(time * 1000)));
if (format.startsWith("!")) {
time-=timeZoneOffset(d);
d.setTime(new Date((long)(time * 1000)));
format=format.substring(1);
}
byte[] fmt=format.getBytes();
final int n=fmt... | If the time argument is present, this is the time to be formatted (see the os.time function for a description of this value). Otherwise, date formats the current time. Date returns the date as a string, formatted according to the same rules as ANSII strftime, but without support for %g, %G, or %V. When called withou... |
public void transform(Source xmlSource,Result outputTarget,boolean shouldRelease) throws TransformerException {
synchronized (m_reentryGuard) {
SerializationHandler xoh=createSerializationHandler(outputTarget);
this.setSerializationHandler(xoh);
m_outputTarget=outputTarget;
transform(xmlSource,shouldRel... | Process the source tree to the output result. |
public static Uri formatURL(String url){
if (url.startsWith("//")) {
url="https:" + url;
}
if (url.startsWith("/")) {
url="https://reddit.com" + url;
}
if (!url.contains("://")) {
url="http://" + url;
}
Uri uri=Uri.parse(url);
return uri.normalizeScheme();
}
| Corrects mistakes users might make when typing URLs, e.g. case sensitivity in the scheme and converts to Uri |
protected void addAgent() throws Exception {
if (agent != null && agent.isDone()) {
env.removeAgent(agent);
agent=null;
}
if (agent == null) {
int pSel=frame.getSelection().getIndex(NQueensFrame.PROBLEM_SEL);
int sSel=frame.getSelection().getIndex(NQueensFrame.SEARCH_SEL);
ActionsFunction af;
... | Creates a new search agent and adds it to the current environment if necessary. |
public OffScenePanel(int width,int height){
this.width=width;
this.height=height;
initComponents();
setupScene();
}
| Creates new form ScenePanel |
public Object runSafely(Catbert.FastStack stack) throws Exception {
ManualRecord mr=Wizard.getInstance().getManualRecord(getAir(stack));
return (mr == null) ? "" : ManualRecord.getRecurrenceName(mr.getRecurrence());
}
| If this Airing is a time-based recording this will get a description of the recurrence frequency for its recording recurrence |
private void buildUI(String[] stockData){
FacesContext context=FacesContext.getCurrentInstance();
UIForm form=(UIForm)context.getViewRoot().findComponent("myform");
UIPanel dataPanel=(UIPanel)form.findComponent("stockdata");
dataPanel.getChildren().clear();
UIPanel titlePanel1=new UIPanel();
UIOutput output... | Helper method to dynamically add JSF components to display the data. |
private void buildRememberPassword(){
final Button checkbox=new Button(this.shell,SWT.CHECK);
final GridData gridData=new GridData(GridData.BEGINNING,GridData.CENTER,true,false,4,1);
gridData.horizontalIndent=35;
checkbox.setLayoutData(gridData);
checkbox.setText(ResourceManager.getLabel(ResourceManager.REMEM... | Build the "remember password" part of the box |
public boolean isShowCrosshair(){
return (worldScene.getShowCrosshair());
}
| Get cross hair visibility |
public void paintSliderBorder(SynthContext context,Graphics g,int x,int y,int w,int h){
}
| Paints the border of a slider. |
public static String decode(String encodedValue,final String encoding){
try {
if (encodedValue != null) {
String previousEncodedValue;
do {
previousEncodedValue=encodedValue;
encodedValue=URLDecoder.decode(encodedValue,encoding);
}
while (!encodedValue.equals(previousEncodedValu... | Decodes the encoded String value using the specified encoding (such as UTF-8). It is assumed the String value was encoded with the URLEncoder using the specified encoding. This method handles UnsupportedEncodingException by just returning the encodedValue. Since it is possible for a String value to have been encoded mu... |
public EqualsMethodAsserter method(String name,Object... values){
Class<?> parameterTypes[]=new Class<?>[values.length];
for (int i=0; i < values.length; i++) {
parameterTypes[i]=values[i].getClass();
}
return method(name,parameterTypes,values);
}
| Defines a method that should be called after creating each object. |
void showSettings(){
if (setdlg == null) {
setdlg=new CommonSettingsDialog(frame);
}
setdlg.setVisible(true);
}
| Called when the user selects the "View->Client Settings" menu item. |
public B missing(Object missingValue){
this.missing=missingValue;
return (B)this;
}
| Configure the value to use when documents miss a value. |
public static void showInfoMsg(final Object... messages){
Sound.beepOnInfo();
JOptionPane.showMessageDialog(LEnv.CURRENT_GUI_FRAME.get(),messages,"Info",JOptionPane.INFORMATION_MESSAGE);
}
| Shows an info message. <p> This method blocks until the dialog is closed. </p> |
public static BigInteger createBigInteger(String val){
BigInteger bi=new BigInteger(val);
return bi;
}
| <p>Convert a <code>String</code> to a <code>BigInteger</code>.</p> |
@Deprecated public Object callReadResolve(final Object result){
return serializationMembers.callReadResolve(result);
}
| Resolves an object as native serialization does by calling readResolve(), if available. |
public UploadResultWindow(final List<UploadStatus> uploadResultList,final I18N i18n){
this.uploadResultList=uploadResultList;
this.i18n=i18n;
eventBus=SpringContextHelper.getBean(EventBus.SessionEventBus.class);
createComponents();
createLayout();
}
| Initialize upload status popup. |
public static long copyLarge(Reader input,Writer output,final long inputOffset,final long length,char[] buffer) throws IOException {
if (inputOffset > 0) {
skipFully(input,inputOffset);
}
if (length == 0) {
return 0;
}
int bytesToRead=buffer.length;
if (length > 0 && length < buffer.length) {
by... | Copy some or all chars from a large (over 2GB) <code>InputStream</code> to an <code>OutputStream</code>, optionally skipping input chars. <p> This method uses the provided buffer, so there is no need to use a <code>BufferedReader</code>. <p> |
public ParserString subCFMLString(int start){
return subCFMLString(start,text.length - start);
}
| Gibt eine Untermenge des CFMLString als CFMLString zurueck, ausgehend von start bis zum Ende des CFMLString. |
public void padWithLen(byte[] in,int off,int len) throws ShortBufferException {
if (in == null) return;
if ((off + len) > in.length) {
throw new ShortBufferException("Buffer too small to hold padding");
}
byte paddingOctet=(byte)(len & 0xff);
for (int i=0; i < len; i++) {
in[i + off]=paddingOctet;
... | Adds the given number of padding bytes to the data input. The value of the padding bytes is determined by the specific padding mechanism that implements this interface. |
public SVGImageElementBridge(){
}
| Constructs a new bridge for the <image> element. |
public static TriggerDefinition toTriggerDefinition(VOTriggerDefinition vo) throws ValidationException {
final TriggerDefinition domObj=new TriggerDefinition();
copyAttributes(domObj,vo);
return domObj;
}
| Converts a value object trigger definition to a domain object representation. |
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case EipPackage.SERVICE_REF__NAME:
setName((String)newValue);
return;
case EipPackage.SERVICE_REF__REFERENCE:
setReference(newValue);
return;
case EipPackage.SERVICE_REF__OPERATIONS:
getOperations().clea... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public ActorMessageTypeInvalidException(String error){
super(error);
}
| Instantiates a new actor message type invalid exception. |
void onDropChild(View child){
if (child != null) {
LayoutParams lp=(LayoutParams)child.getLayoutParams();
lp.dropped=true;
child.requestLayout();
}
}
| Mark a child as having been dropped. At the beginning of the drag operation, the child may have been on another screen, but it is re-parented before this method is called. |
protected static void parseContentTypeParams(ByteArrayInputStream pduDataStream,HashMap<Integer,Object> map,Integer length){
assert (null != pduDataStream);
assert (length > 0);
int startPos=pduDataStream.available();
int tempPos=0;
int lastLen=length;
while (0 < lastLen) {
int param=pduDataStream.read(... | Parse content type parameters. For now we just support four parameters used in mms: "type", "start", "name", "charset". |
public NPCEmoteAction(String npcAction){
this.npcAction=npcAction.trim();
}
| Creates a new EmoteAction. |
public static <T>T byte2Obj(byte[] bytes,org.codehaus.jackson.type.TypeReference<T> typeReference){
if (bytes == null || typeReference == null) {
return null;
}
try {
return (T)(typeReference.getType().equals(byte[].class) ? bytes : objectMapper.readValue(bytes,typeReference));
}
catch ( Exception e) ... | byte[] => Object |
public void scrollToFinishActivity(){
final int childWidth=mContentView.getWidth();
int left=0, top=0;
left=childWidth + mShadowLeft.getIntrinsicWidth() + OVERSCROLL_DISTANCE;
mDragHelper.smoothSlideViewTo(mContentView,left,top);
invalidate();
}
| Scroll out contentView and finish the activity |
public void ReInit(JavaCharStream stream){
jjmatchedPos=jjnewStateCnt=0;
curLexState=defaultLexState;
input_stream=stream;
ReInitRounds();
}
| Reinitialise parser. |
protected void sequence_TAnonymousFormalParameter(ISerializationContext context,TAnonymousFormalParameter semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: TAnonymousFormalParameter returns TAnonymousFormalParameter Constraint: (variadic?='...'? name=BindingIdentifier? typeRef=TypeRef) |
public void addContentView(View newContentView){
contentLayout.addView(newContentView);
contentLayout.invalidate();
}
| Add a view into the Content LinearLayout, the LinearLayout that expands or collapse in a fashion way. |
public static boolean addCompressionRecipe(ItemStack aInput,ItemStack aOutput){
aOutput=GT_OreDictUnificator.get(true,aOutput);
if (aInput == null || aOutput == null) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput,getCompressorRecipeList(),null);
if (!GregTech_API.sRecipeFile.get(ConfigCategorie... | IC2-Compressor Recipe. Overloads old Recipes automatically |
public SnapshotId(String repository,String snapshot){
this.repository=repository;
this.snapshot=snapshot;
this.hashCode=computeHashCode();
}
| Constructs new snapshot id |
public ModuleAction(final ConfAction jsubaction){
super(jsubaction);
}
| Instantiates a new stop agent action. |
public ConditionalRouteTest(String name){
super(name);
}
| Constructs a new Conditional Route test case with the given name. <!-- begin-user-doc --> <!-- end-user-doc --> |
public SyntheticMethodBinding(SourceTypeBinding declaringEnum,int startIndex,int endIndex){
this.declaringClass=declaringEnum;
SyntheticMethodBinding[] knownAccessMethods=declaringEnum.syntheticMethods();
this.index=knownAccessMethods == null ? 0 : knownAccessMethods.length;
StringBuffer buffer=new StringBuffer... | Construct enum special methods: values or valueOf methods |
static int indexOf(final CharSequence cs,final CharSequence searchChar,final int start){
return cs.toString().indexOf(searchChar.toString(),start);
}
| Used by the indexOf(CharSequence methods) as a green implementation of indexOf. |
private void calculateMaxValue(int seriesCount,int catCount){
double v;
Number nV;
for (int seriesIndex=0; seriesIndex < seriesCount; seriesIndex++) {
for (int catIndex=0; catIndex < catCount; catIndex++) {
nV=getPlotValue(seriesIndex,catIndex);
if (nV != null) {
v=nV.doubleValue();
... | loop through each of the series to get the maximum value on each category axis |
void callbackToActivity(String clientHandle,Status status,Bundle dataBundle){
Intent callbackIntent=new Intent(MqttServiceConstants.CALLBACK_TO_ACTIVITY);
if (clientHandle != null) {
callbackIntent.putExtra(MqttServiceConstants.CALLBACK_CLIENT_HANDLE,clientHandle);
}
callbackIntent.putExtra(MqttServiceConst... | pass data back to the Activity, by building a suitable Intent object and broadcasting it |
public boolean isMarkedForRemoval(){
return markedForRemoval;
}
| Gets the value of the markedForRemoval property. |
public ServiceCall<Void> deleteCorpus(String customizationId,String corpusName){
Validator.notNull(customizationId,"customizationId cannot be null");
Validator.notNull(corpusName,"corpusName cannot be null");
RequestBuilder requestBuilder=RequestBuilder.delete(String.format(PATH_CORPUS,customizationId,corpusName)... | Delete customization corpus. |
public Supplier<Pair<Integer,JsonNode>> handleDelete(StateContext state) throws HttpStatusException {
throw new UnsupportedOperationException(this.getClass().toString());
}
| Handle delete. |
static String encodeEntities(String source){
StringBuffer buffer=new StringBuffer();
String encoded;
for (int index=0; index < source.length(); index++) {
char ch=source.charAt(index);
if ((encoded=encodeEntity(ch)) != null) {
buffer.append(encoded);
}
else {
buffer.append(ch);
}
}
... | Utility method for encoding HTML entities within query parameters. |
@Override public void eUnset(int featureID){
switch (featureID) {
case UmplePackage.ANONYMOUS_MORE_CODE_1__CODE_LANG_1:
getCodeLang_1().clear();
return;
case UmplePackage.ANONYMOUS_MORE_CODE_1__CODE_LANGS_1:
getCodeLangs_1().clear();
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void cmd_query(){
boolean reports=reportField.isChecked();
ListItem listitem=processField.getSelectedItem();
KeyNamePair process=null;
if (listitem != null) process=(KeyNamePair)listitem.getValue();
listitem=tableField.getSelectedItem();
KeyNamePair table=null;
if (listitem != null) table=(Key... | Create Query |
public static String buildClusterCgName(String clusterName,String cgName){
return String.format("%s" + SPLITTER + "%s",clusterName,cgName);
}
| Builds a concatenated name combining the cluster name and consistency group name. This is used for mapping VPlex storage systems to their corresponding cluster consistency groups. |
protected void loadThisOrOwner(){
if (isInnerClass()) {
visitFieldExpression(new FieldExpression(controller.getClassNode().getDeclaredField("owner")));
}
else {
loadThis(null);
}
}
| Loads either this object or if we're inside a closure then load the top level owner |
protected void sequence_Wildcard_WildcardNewNotation(ISerializationContext context,Wildcard semanticObject){
genericSequencer.createSequence(context,semanticObject);
}
| Contexts: TypeArgument returns Wildcard Constraint: ( declaredUpperBound=TypeRef | declaredLowerBound=TypeRef | (usingInOutNotation?='out' declaredUpperBound=TypeRef) | (usingInOutNotation?='in' declaredLowerBound=TypeRef) )? |
private void info(String msg){
if (logLevel.intValue() <= Level.INFO.intValue()) {
println(Level.INFO,msg);
}
}
| Used internally to log a message about the class at level INFO |
boolean addModule(@Nonnull String moduleName){
verifyIsRoot();
if (children.containsKey(moduleName)) {
children.get(moduleName).resetHierarchy();
return false;
}
else {
CounterNode newNode=new CounterNode(ImmutableList.of(moduleName),null);
children.put(moduleName,newNode);
return true;
}
}... | Add the given moduleName to the tree. Can only be called on the root. If the module already exists, the all counters of the module will be reset. |
public void testDragOutOfTouchable(){
View outsideView=getViewByTestId("E");
View innerButton=getViewByTestId("A");
SingleTouchGestureGenerator gestureGenerator=createGestureGenerator();
gestureGenerator.startGesture(innerButton);
waitForBridgeAndUIIdle();
gestureGenerator.dragTo(outsideView,15).endGesture(... | Start gesture at view A, then drag and release on view {E}. Expect no touch handlers to fire |
private void updateGwt27On(IJavaProject javaProject,List<String> programArgs,int indexDisabled,int indexEnabled,boolean superDevModeEnabled){
if (indexEnabled > -1) {
programArgs.remove(indexEnabled);
}
if (indexDisabled > -1) {
programArgs.remove(indexDisabled);
}
if (!superDevModeEnabled) {
prog... | Update program args for project GWT >= 2.7 use this for Dev Mode -nosuperDevMode and nothing for super dev mode. |
public double compute(int... dataset){
return computeInPlace(intsToDoubles(dataset));
}
| Computes the quantile value of the given dataset. |
@ZeppelinApi public Object angular(String name){
AngularObject ao=getAngularObject(name,interpreterContext);
if (ao == null) {
return null;
}
else {
return ao.get();
}
}
| Get angular object. Look up notebook scope first and then global scope |
public QueueReader<E> reader(){
return new QueueReader<E>((E[])q,index);
}
| Create reader which will read objects from the queue. |
public synchronized boolean performJoin(OsmElement element,Node nodeToJoin) throws OsmIllegalOperationException {
boolean mergeOK=true;
if (element instanceof Node) {
Node node=(Node)element;
createCheckpoint(R.string.undo_action_join);
mergeOK=getDelegator().mergeNodes(node,nodeToJoin);
map.invalid... | Join a node to a node or way at the point on the way closest to the node. |
public PersistentCookieStore(Context context){
cookiePrefs=context.getSharedPreferences(COOKIE_PREFS,0);
cookies=new ConcurrentHashMap<String,Cookie>();
String storedCookieNames=cookiePrefs.getString(COOKIE_NAME_STORE,null);
if (storedCookieNames != null) {
String[] cookieNames=TextUtils.split(storedCookieN... | Construct a persistent cookie store. |
protected Compression(int value){
super(value);
}
| Construct a new compression enumeration value with the given integer value. |
public void actionPerformed(java.awt.event.ActionEvent ae){
String cmd=ae.getActionCommand();
server=serverAddrField.getText();
port=serverPortField.getText();
if (cmd == GetViewsCmd) {
connectedStatus.setText(STATUS_CONNECTING);
viewList=getViews();
if (viewList == null) {
Debug.message("netm... | Act on GUI commands controlling the NetMapReader. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private static synchronized String nextID(){
return prefix + Long.toString(id++);
}
| Returns the next unique id. Each id made up of a short alphanumeric prefix along with a unique numeric value. |
public static double[][] minus(double[][] v1,double v2){
double[][] array=new double[v1.length][v1[0].length];
for (int i=0; i < v1.length; i++) for (int j=0; j < v1[0].length; j++) array[i][j]=v1[i][j] - v2;
return array;
}
| Subtract a scalar from each element of a matrix. |
protected void processFailure(BaseStunMessageEvent event){
String receivedResponse;
if (event instanceof StunFailureEvent) receivedResponse="unreachable";
else if (event instanceof StunTimeoutEvent) receivedResponse="timeout";
else receivedResponse="failure";
receivedResponses.add(receivedResponse);
}
| Notifies this <tt>ResponseCollector</tt> that a transaction described by the specified <tt>BaseStunMessageEvent</tt> has failed. The possible reasons for the failure include timeouts, unreachable destination, etc. |
public boolean isOngoing(){
return isOngoingStorage.get();
}
| The state of the current pomodoro. |
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. |
@Override public final short readShort() throws IOException {
dis.readFully(work,0,2);
return (short)((work[1] & 0xff) << 8 | (work[0] & 0xff));
}
| Read short, 16-bits. Like DataInputStream.readShort except little endian. |
public static void add(List<String> options,char option,int value){
add(options,"" + option,value);
}
| Adds the int value to the options. |
private static void pixel(double x,double y){
offscreen.fillRect((int)Math.round(scaleX(x)),(int)Math.round(scaleY(y)),1,1);
}
| Draw one pixel at (x, y). |
private static double distanceSq(Color a,Color b){
double rMean=(a.getRed() + b.getRed()) / 256.0 / 2.0;
double dr=(a.getRed() - b.getRed()) / 256.0;
double dg=(a.getGreen() - b.getGreen()) / 256.0;
double db=(a.getBlue() - b.getBlue()) / 256.0;
double d=(2.0 + rMean) * dr * dr + 4.0 * dg * dg + (2.0 + 1.0 - ... | Calculates the square of the distance between the two specified Colors. |
public E removeFirst(){
if (head == null) {
throw new NoSuchElementException("Nothing in List");
}
E value=head.value;
head=head.next;
if (head != null) {
head.prev=null;
}
else {
last=null;
}
size--;
return value;
}
| Remove first element without altering sort order. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:28.615 -0500",hash_original_method="713B19D560033B1B50E26BAD17DD5FF2",hash_generated_method="A5AC41D84F7549396CE8AAD5A06BF8E9") protected void releaseManagedConnection() throws IOException {
if (managedConn != null) {
try {
... | Releases the connection gracefully. The connection attribute will be nullified. Subsequent invocations are no-ops. |
public void test_getLjava_lang_ObjectI(){
int[] x={1};
Object ret=null;
boolean thrown=false;
try {
ret=Array.get(x,0);
}
catch ( Exception e) {
fail("Exception during get test : " + e.getMessage());
}
assertEquals("Get returned incorrect value",1,((Integer)ret).intValue());
try {
ret=Arra... | java.lang.reflect.Array#get(java.lang.Object, int) |
private synchronized void updateOrResetReqPerMinPerHrLstDay(float incr,boolean reset){
updateOrResetSampledValues(incr,reset,_reqPerMinHrDay);
}
| Updates or resets the request per minute per hour in the last day counter |
private void convert(Problem problem,boolean reduced,ResultFileReader reader,PrintWriter writer){
int numberOfVariables=problem.getNumberOfVariables();
int numberOfObjectives=problem.getNumberOfObjectives();
if (reduced) {
numberOfVariables=0;
}
while (reader.hasNext()) {
ResultEntry entry=reader.next... | Converts and writes the contents of the result file to the Aerovis format. |
public void callPredicateVisitors(XPathVisitor visitor){
m_expr.callVisitors(new filterExprOwner(),visitor);
super.callPredicateVisitors(visitor);
}
| This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called. |
public IndexedImage(int width,int height,int[] palette,byte[] data){
super(null);
this.width=width;
this.height=height;
this.palette=palette;
this.imageDataByte=data;
initOpaque();
}
| Creates an indexed image with byte data |
@Override public void onSlotRemoved(final RPObject object,final String slotName,final RPObject sobject){
}
| A slot object was removed. |
private ContextHandler createContextHandler(String directory,boolean isInJar,File installRootDirectory,int expiresInSeconds){
final ContextHandler contextHandler=new ContextHandler();
final ResourceHandler resourceHandler=new ExpiresResourceHandler(expiresInSeconds);
final String directoryWithSlash="/" + director... | Creates a context handler for the directory. |
public void monitorEnter(){
mv.visitInsn(Opcodes.MONITORENTER);
}
| Generates the instruction to get the monitor of the top stack value. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.