code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public SelectionColorChooserAction(DrawingEditor editor,AttributeKey<Color> key){
this(editor,key,null,null);
}
| Creates a new instance. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
double slope;
double z, z2;
int c, i;
int progress;
int[] dY={-1,0,1,1,1,0,-1,-1};
int[] dX={1,1,1,0,-1,-1,-1,0};
int row, col, x, y;
double dist;
double maxSlope=0;
double maxZChange=0;
if (args.... | Used to execute this plugin tool. |
@Override protected final void parseArgs(String[] args) throws AdeException {
super.parseArgs(new Options(),args);
}
| Parse the input arguments |
protected void enableOtherNotifications(TransactionBuilder builder,boolean enable){
builder.notify(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS),enable).notify(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_SENSOR_DATA),enable);
}
| Enables or disables certain kinds of notifications that could interfere with this operation. Call this method once initially to disable other notifications, and once when this operation has finished. |
private void drawFirstAnimation(Canvas canvas){
if (radius1 < getWidth() / 2) {
Paint paint=new Paint();
paint.setAntiAlias(true);
paint.setColor(makePressColor());
radius1=(radius1 >= getWidth() / 2) ? (float)getWidth() / 2 : radius1 + 1;
canvas.drawCircle(getWidth() / 2,getHeight() / 2,radius1,p... | Draw first animation of view |
public void emitDirect(int taskId,Tuple anchor,List<Object> tuple){
emitDirect(taskId,Utils.DEFAULT_STREAM_ID,anchor,tuple);
}
| Emits a tuple directly to the specified task id on the default stream. If the target bolt does not subscribe to this bolt using a direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes with a non-direct grouping, an error will occur at runtim... |
CSVReader(Reader reader,int line,CSVParser csvParser,boolean keepCR,boolean verifyReader){
this.br=(reader instanceof BufferedReader ? (BufferedReader)reader : new BufferedReader(reader,30720));
this.lineReader=new LineReader(br,keepCR);
this.skipLines=line;
this.parser=csvParser;
this.keepCR=keepCR;
this.v... | Constructs CSVReader with supplied CSVParser. |
public static void addOsmiumCompressorRecipe(ItemStack input,ItemStack output){
try {
Class recipeClass=Class.forName("mekanism.common.recipe.RecipeHandler");
Method m=recipeClass.getMethod("addOsmiumCompressorRecipe",ItemStack.class,ItemStack.class);
m.invoke(null,input,output);
}
catch ( Exception e... | Add an Osmium Compressor recipe. |
public void testPrintMessageBuilder() throws Exception {
String javaText=TextFormat.printToString(TestUtil.getAllSetBuilder());
javaText=javaText.replace(".0\n","\n");
assertEquals(allFieldsSetText,javaText);
}
| Print TestAllTypes as Builder and compare with golden file. |
@EventHandler(ignoreCancelled=true) public void onItemSpawn(ItemSpawnEvent event){
Match match=Cardinal.getMatch(event.getWorld());
MaterialData data=event.getEntity().getItemStack().getData();
for ( MaterialType type : materials.get(match)) {
if (type.isType(data)) {
event.setCancelled(true);
br... | Prevent items from spawning if they are in the item-remove tag in XML. |
public boolean hasClauses(){
return !(mustClauses.isEmpty() && shouldClauses.isEmpty() && mustNotClauses.isEmpty()&& filterClauses.isEmpty());
}
| Returns <code>true</code> iff this query builder has at least one should, must, must not or filter clause. Otherwise <code>false</code>. |
public void start(@NonNull Context context,@NonNull Fragment fragment){
start(context,fragment,REQUEST_CROP);
}
| Send the crop Intent from a Fragment |
public static void checkIfSavable(final Process process) throws Exception {
for ( Operator operator : process.getAllOperators()) {
if (operator instanceof DummyOperator) {
throw new Exception("The process contains dummy operators. Remove all dummy operators or install all missing extensions in order to sav... | Checks weather the process can be saved as is. Throws an Exception if the Process should not be saved. |
private static int decodeDigit(int[] counters) throws NotFoundException {
int bestVariance=MAX_AVG_VARIANCE;
int bestMatch=-1;
int max=PATTERNS.length;
for (int i=0; i < max; i++) {
int[] pattern=PATTERNS[i];
int variance=patternMatchVariance(counters,pattern,MAX_INDIVIDUAL_VARIANCE);
if (variance <... | Attempts to decode a sequence of ITF black/white lines into single digit. |
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.activity_create_widget_clock_day_week_doneButton:
SharedPreferences.Editor editor=getSharedPreferences(getString(R.string.sp_widget_clock_day_week_setting),MODE_PRIVATE).edit();
editor.putString(getString(R.string.key_location),location.locatio... | <br> interface. |
public void testGenerateCertPath03() throws Exception {
String certPathEncoding="PkiPath";
CertificateFactory[] certFs=initCertFs();
assertNotNull("CertificateFactory objects were not created",certFs);
for (int i=0; i < certFs.length; i++) {
Iterator<String> it=certFs[0].getCertPathEncodings();
assertTr... | Test for <code>generateCertPath(InputStream inStream)</code> method Assertion: returns CertPath with 1 Certificate |
public void cancel(){
cancel=true;
}
| Call this method to cancel drag interaction. |
public boolean equals(JulianDate d){
return (julian == d.julian);
}
| Checks if the specified date is eual to this date. |
public void put(int key,int value){
int i=binarySearch(mKeys,0,mSize,key);
if (i >= 0) {
mValues[i]=value;
}
else {
i=~i;
if (mSize >= mKeys.length) {
int n=Math.max(mSize + 1,mKeys.length * 2);
int[] nkeys=new int[n];
int[] nvalues=new int[n];
System.arraycopy(mKeys,0,nkeys,0... | Adds a mapping from the specified key to the specified value, replacing the previous mapping from the specified key if there was one. |
public List<RDOPaymentPreviewSummary> evaluateBillingResultForPaymentPreview(RDOSummary summaryTemplate,Document doc,PlatformUser user,PriceConverter formatter,Long paymentPreviewEndTime) throws XPathExpressionException, SQLException {
this.formatter=formatter;
this.document=doc;
return evaluateBillingResult(summ... | Evaluates a billing result and creates the corresponding data objects for payment preview report |
public TemplatePersistenceData(Template template,boolean enabled,String id){
Assert.isNotNull(template);
fOriginalTemplate=template;
fCustomTemplate=template;
fOriginalIsEnabled=enabled;
fCustomIsEnabled=enabled;
fId=id;
}
| Creates a new instance. If <code>id</code> is not <code>null</code>, the instance is represents a template that is contributed and can be identified via its id. |
public boolean equals(Object obj){
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
MessageFormat other=(MessageFormat)obj;
return (maxOffset == other.maxOffset && pattern.equals(other.pattern) && ((locale != null && locale.equals(other.locale)) || (locale == null... | Equality comparison between two message format objects |
public void putNull(String key){
mValues.put(key,null);
}
| Adds a null value to the set. |
public static void main(final String[] args){
DOMTestCase.doMain(elementsetattributens08.class,args);
}
| Runs this test from the command line. |
public boolean isIgnoringOrder(){
return _isIgnoringOrder;
}
| Gets IgnoringOrder flag. <p/> <br> This flag is used to determine if order in which elements occur in Golden <p/>and current Document is ignored |
public TenantDeletionConstraintException(String message){
super(message);
}
| Constructs a new exception with the specified detail message. The cause is not initialized. |
public void onClickPlaneta(View view){
Intent intent=new Intent(this,PlanetaActivity.class);
ActivityOptionsCompat opts=ActivityOptionsCompat.makeCustomAnimation(this,R.anim.slide_in_left,R.anim.slide_out_left);
ActivityCompat.startActivity(this,intent,opts.toBundle());
}
| Demonstra uma animacao customizada de entrada e saida |
public PriorityQueue(int initialCapacity){
this(initialCapacity,null);
}
| Constructs a priority queue with the specified capacity and natural ordering. |
public void deregisterPort(int port,IgnitePortProtocol proto,Class cls){
assert port > 0 && port < 65535;
assert proto != null;
assert cls != null;
synchronized (recs) {
for (Iterator<GridPortRecord> iter=recs.iterator(); iter.hasNext(); ) {
GridPortRecord pr=iter.next();
if (pr.port() == port && ... | Deregisters port used by passed class. |
public boolean isOverrides(MembershipRecord r0){
if (r0 == null) {
return true;
}
checkArgument(this.member.equals(r0.member),"Can't compare records for different members");
if (r0.status == DEAD) {
return false;
}
if (status == DEAD) {
return true;
}
if (incarnation == r0.incarnation) {
... | Checks either this record overrides given record. |
private void replaceTop(Scope topOfStack){
stack.set(stack.size() - 1,topOfStack);
}
| Replace the value on the top of the stack with the given value. |
@Override public void contextInitialized(ServletContextEvent event){
this.context=event.getServletContext();
log("contextInitialized()");
}
| Record the fact that this web application has been initialized. |
private void signIdToken(final ClientDetailsEntity client,final JWSAlgorithm signingAlg,final OAuth2AccessTokenEntity idTokenEntity,final JWTClaimsSet.Builder idClaims){
log.debug("Client {} is configured to ignore encryption",client.getClientId());
final JWT idToken;
if (signingAlg.equals(Algorithm.NONE)) {
... | Sign id token. |
public ExitData(S source,S target){
this.source=source;
this.target=target;
}
| Instantiates a new exit data. |
private void removeMethodIfStupid(SootClass clz,SootMethod method){
boolean debug=false;
StmtBody stmtBody=null;
try {
stmtBody=(StmtBody)method.retrieveActiveBody();
}
catch ( Exception ex) {
logger.info("Exception retrieving method body {}",ex);
return;
}
if (debug) logger.debug("looking a... | Remove a method if all it does is call the super method with the same args. |
public void loadMarkdown(String txt,String cssFileUrl){
loadMarkdownToView(txt,cssFileUrl);
}
| Loads the given Markdown text to the view as rich formatted HTML. The HTML output will be styled based on the given CSS file. |
protected void clearList(){
int listSize=getItemCount();
this.list.clear();
notifyItemRangeRemoved(0,listSize);
}
| Clear all items that are in the list. |
public static SearchRecentSuggestions newHelper(Context context){
return new SearchRecentSuggestions(context,AUTHORITY,MODE);
}
| Creates and returns a helper for adding recent queries or clearing the recent query history. |
@Override public boolean supportsSchemasInIndexDefinitions(){
debugCodeCall("supportsSchemasInIndexDefinitions");
return true;
}
| Returns whether the schema name in CREATE INDEX is supported. |
private IBindingSet aggregate(final Iterable<IBindingSet> solutions){
final IBindingSet aggregates=new ContextBindingSet(context,new ListBindingSet());
if (groupBy != null) {
final IBindingSet aSolution=solutions.iterator().next();
for ( IValueExpression<?> expr : groupBy) {
if (expr instanceof IVa... | Compute the aggregate solution for a solution multiset (aka a group). |
public CStepIntoAction(final JFrame parent,final IFrontEndDebuggerProvider debugger){
m_parent=Preconditions.checkNotNull(parent,"IE00310: Parent argument can not be null");
m_debugger=Preconditions.checkNotNull(debugger,"IE01544: Debugger argument can not be null");
putValue(Action.SHORT_DESCRIPTION,"Step Into")... | Creates a new single step action. |
public static void applySampledState(SampledVertex v,Attributes attrs){
String str=attrs.getValue(SAMPLED_ATTR);
if (str != null) v.sample(new Integer(str));
}
| Parses the attributes data for information of the sampled state of the vertex and sets the vertex to the corresponding state. |
private static void appendCommandStatus(final PrintWriter writer,final IStatus CommandStatus,final int nesting){
for (int i=0; i < nesting; i++) {
writer.print(" ");
}
writer.println(CommandStatus.getMessage());
final IStatus[] children=CommandStatus.getChildren();
for (int i=0; i < children.length; i++)... | Append CommandStatus. |
private void fillFromArguments(String[] arguments){
for ( String string : arguments) {
if (!string.startsWith("--")) {
throw new IllegalArgumentException("illegal parameter: " + string);
}
String param=string.substring(2);
String params[]=param.split("=",2);
boolean found=false;
for ( ... | Parse arguments. |
private ExpirationAction(String name){
this.name=name;
}
| Creates a new instance of ExpirationAction. |
public void resetPattern(String pattern){
normalize(pattern);
}
| Resets the search pattern. |
public void testResourcesAvailable(){
new PortugueseAnalyzer().close();
}
| This test fails with NPE when the stopwords file is missing in classpath |
public static boolean isLauncherAppTarget(Intent launchIntent){
if (launchIntent != null && Intent.ACTION_MAIN.equals(launchIntent.getAction()) && launchIntent.getComponent() != null && launchIntent.getCategories() != null && launchIntent.getCategories().size() == 1 && launchIntent.hasCategory(Intent.CATEGORY_LAUNCHE... | Returns true if the intent is a valid launch intent for a launcher activity of an app. This is used to identify shortcuts which are different from the ones exposed by the applications' manifest file. |
public static Class[] resolveAllInterfaces(Class type){
Set<Class> bag=new LinkedHashSet<>();
_resolveAllInterfaces(type,bag);
return bag.toArray(new Class[bag.size()]);
}
| Resolves all interfaces of a type. No duplicates are returned. Direct interfaces are prior the interfaces of subclasses in the returned array. |
public ProtocolDecoderException(Throwable cause){
super(cause);
}
| Constructs a new instance with the specified cause. |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
if (lagGraph == null) {
throw new NullPointerException();
}
}
| Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObj... |
protected SQLException logAndConvert(Exception ex){
SQLException e=DbException.toSQLException(ex);
if (trace == null) {
DbException.traceThrowable(e);
}
else {
int errorCode=e.getErrorCode();
if (errorCode >= 23000 && errorCode < 24000) {
trace.info(e,"exception");
}
else {
trace.err... | Log an exception and convert it to a SQL exception if required. |
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
| Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface. |
public void compute_default(){
int i, prod, max_prod, max_red;
if (reduction_count == null) reduction_count=new int[production.number()];
for (i=0; i < production.number(); i++) reduction_count[i]=0;
max_prod=-1;
max_red=0;
for (i=0; i < size(); i++) if (under_term[i].kind() == parse_action.REDUCE) {
... | Compute the default (reduce) action for this row and store it in default_reduce. In the case of non-zero default we will have the effect of replacing all errors by that reduction. This may cause us to do erroneous reduces, but will never cause us to shift past the point of the error and never cause an incorrect p... |
public void KillRandomBlordroughs(int numb){
for (int i=0; i < numb; i++) {
KillRandomBlordrough();
}
logger.debug("killed " + numb + " creatures.");
}
| function for emulating killing of blordrough soldiers by player. |
public static void error(Throwable problem){
_errorCallback.error(problem);
}
| Displays the error to the user. |
public OsmMoveAction(MapWay way,int fromNodeIdx,int toNodeIdx){
this.way=way;
fromIndex=fromNodeIdx;
toIndex=toNodeIdx;
}
| The indices correspond to the list of nodes stored with the way. |
public VPAttributeDialog(Frame frame,int M_AttributeSetInstance_ID,int M_Product_ID,int C_BPartner_ID,boolean productWindow,int AD_Column_ID,int WindowNo,boolean readWrite){
super(frame,Msg.translate(Env.getCtx(),"M_AttributeSetInstance_ID"),true);
log.config("M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID... | Product Attribute Instance Dialog |
public static long quantile(long[] values,double quantile){
if (values == null) throw new IllegalArgumentException("Values cannot be null.");
if (quantile < 0.0 || quantile > 1.0) throw new IllegalArgumentException("Quantile must be between 0.0 and 1.0");
long[] copy=new long[values.length];
System.arraycop... | Compute the requested quantile of the given array |
public PaintListenerSupport(){
this(null);
}
| Construct a PaintListenerSupport. |
public String fromId(){
return fromId;
}
| From vertex id. |
protected void configureCoreUI(){
GinMultibinder<PreferencePagePresenter> prefBinder=GinMultibinder.newSetBinder(binder(),PreferencePagePresenter.class);
prefBinder.addBinding().to(AppearancePresenter.class);
prefBinder.addBinding().to(ExtensionManagerPresenter.class);
GinMultibinder<Theme> themeBinder=GinMulti... | Configure Core UI components, resources and views |
public void invert(final int ulx,final int uly,final int lrx,final int lry){
filter(ulx,uly,lrx,lry,FilterMode.FILTER_INVERT,-1);
}
| invert filter for a square part of the image |
public UpdateSettingsRequest(Settings settings,String... indices){
this.indices=indices;
this.settings=settings;
}
| Constructs a new request to update settings for one or more indices |
public void close() throws IOException {
mFd.close();
}
| Convenience for calling <code>getParcelFileDescriptor().close()</code>. |
@Override public int remove(final byte[] termHash,final HandleSet urlHashes) throws IOException {
this.countCache.remove(termHash);
final int removed=this.ram.remove(termHash,urlHashes);
int reduced;
try {
reduced=this.array.reduce(termHash,new RemoveReducer<ReferenceType>(urlHashes));
}
catch ( final S... | remove url references from a selected word hash. this deletes also in the BLOB files, which means that there exists new gap entries after the deletion The gaps are never merged in place, but can be eliminated when BLOBs are merged into new BLOBs. This returns the sum of all url references that have been removed |
public void trace(String msg){
innerLog(Level.TRACE,null,msg,UNKNOWN_ARG,UNKNOWN_ARG,UNKNOWN_ARG,null);
}
| Log a trace message. |
private boolean isInactiveField(){
return _property.getName().equals(DataObject.INACTIVE_FIELD_NAME);
}
| Time UUID is always required for inactive field. We depends on the timestamp to validate modification time of inactive field |
@Deprecated public boolean requestDefaultFocus(){
Container nearestRoot=(isFocusCycleRoot()) ? this : getFocusCycleRootAncestor();
if (nearestRoot == null) {
return false;
}
Component comp=nearestRoot.getFocusTraversalPolicy().getDefaultComponent(nearestRoot);
if (comp != null) {
comp.requestFocus();
... | In release 1.4, the focus subsystem was rearchitected. For more information, see <a href="https://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html"> How to Use the Focus Subsystem</a>, a section in <em>The Java Tutorial</em>. <p> Requests focus on this <code>JComponent</code>'s <code>FocusTraversalPolicy</code>'... |
private Organization createOrganization() throws Exception {
Organization organization=new Organization();
organization.setOrganizationId("testOrg");
organization.setRegistrationDate(123L);
organization.setCutOffDay(1);
mgr.persist(organization);
mgr.flush();
return organization;
}
| Helper method for creating technical product. |
public void testGetAttributes(){
char expectedId1=20;
char expectedId2=21;
char actualId1;
char actualId2;
unknownAttributesAttribute.addAttributeID(expectedId1);
unknownAttributesAttribute.addAttributeID(expectedId2);
Iterator<Character> iterator=unknownAttributesAttribute.getAttributes();
actualId1=it... | Same as testGetAttributeID, only attribute attributes are extracted through the getAttributes()'s iterator. |
public MyHashMap(int initialCapacity){
this(initialCapacity,DEFAULT_MAX_LOAD_FACTOR);
}
| Construct a map with the specified initial capacity and default load factor |
public synchronized void flush(){
sampleHolder=new SampleHolder(SampleHolder.BUFFER_REPLACEMENT_MODE_NORMAL);
parsing=false;
result=null;
error=null;
runtimeError=null;
}
| Flushes the helper, canceling the current parsing operation, if there is one. |
@Override public void mouseReleased(GlobalMouseEvent event){
}
| Invoked when a mouse button was released. |
@Ignore @Test public final void testSaveWithNull(){
thrown.expect(ConstraintViolationException.class);
srv.save(null);
}
| Test to call save with null argument. |
public TrackerDataHelper(Context context){
this(context,NO_FORMATTER);
}
| Creates a instance with no output formatting capabilities. Useful for clients that require write-only access |
public boolean isCancelled(){
return cancelled;
}
| Returns true if task is cancelled. |
public PopupEncoder2Menu(){
super();
initialize();
}
| This method initializes |
public static LC parseLayoutConstraint(String s){
LC lc=new LC();
if (s.length() == 0) {
return lc;
}
String[] parts=toTrimmedTokens(s,',');
for (int i=0; i < parts.length; i++) {
String part=parts[i];
if (part == null) {
continue;
}
int len=part.length();
if (len == 3 || len == ... | Parses the layout constraints and stores the parsed values in the transient (cache) member varables. |
public static PickResults doPick(Spatial root,final Ray3 pickRay){
root.updateWorldBound(true);
final PrimitivePickResults bpr=new PrimitivePickResults();
bpr.setCheckDistance(true);
PickingUtil.findPick(root,pickRay,bpr);
if (bpr.getNumber() == 0) {
return (null);
}
PickData closest=bpr.getPickData(0... | Do a pick operation on a spatial |
private MigrationInfoDumper(){
}
| Prevent instantiation. |
public void testOneTrackOneSegment() throws Exception {
Capture<Track> track=new Capture<Track>();
Location location0=createLocation(0,DATE_FORMAT_0.parse(TRACK_TIME_0).getTime());
Location location1=createLocation(1,DATE_FORMAT_1.parse(TRACK_TIME_1).getTime());
expect(myTracksProviderUtils.insertTrack((Track)A... | Tests one track with one segment. |
public CloseSessionResponse CloseSession(CloseSessionRequest req) throws ServiceFaultException, ServiceResultException {
return (CloseSessionResponse)channel.serviceRequest(req);
}
| Synchronous CloseSession service request. |
public Object removeAttributeValue(AttributeKey<?> key){
return removeAttributeValue(key.getId());
}
| Remove attribute (if present). |
public Yaml(){
this(new Constructor(),new Representer(),new DumperOptions(),new Resolver());
}
| Create Yaml instance. It is safe to create a few instances and use them in different Threads. |
public TrunkingSquelchController(boolean allowSquelchOverride){
mAllowSquelchOverride=allowSquelchOverride;
mSquelchMode=SquelchMode.AUTOMATIC;
}
| Provides control over audio stream as directed by an external trunking channel state. Override automatic squelch control by setting the squelch mode to none. Disable automatic control override by setting allowManualOverride to false; Note: this control does not respond to squelch mode manual. |
final protected int depth(Node node){
int i=0;
while ((node=node.jjtGetParent()) != null) {
i++;
}
return i;
}
| Return the depth of the node in the parse tree. The depth is ZERO (0) if the node does not have a parent. |
@Override public long runTask(){
if (CurrentTime.isTest()) {
return -1;
}
_lastTime=CurrentTime.getExactTime();
while (true) {
long now=CurrentTime.getExactTime();
long next=_clock.extractAlarm(now,false);
if (next < 0) {
return 120000L;
}
else if (now < next) {
return Math.... | Runs the coordinator task. |
public void appendStart(StringBuffer buffer,Object object){
if (object != null) {
appendClassName(buffer,object);
appendIdentityHashCode(buffer,object);
appendContentStart(buffer);
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer);
}
}
}
| <p>Append to the <code>toString</code> the start of data indicator.</p> |
public void addInvokedynamic(int bootstrap,String name,String desc){
int nt=constPool.addNameAndTypeInfo(name,desc);
int dyn=constPool.addInvokeDynamicInfo(bootstrap,nt);
add(INVOKEDYNAMIC);
addIndex(dyn);
add(0,0);
growStack(Descriptor.dataSize(desc));
}
| Appends INVOKEDYNAMIC. |
public void unsetParamCode(){
this.paramCode=null;
}
| Description: <br> |
@Override public boolean onUsed(final RPEntity user){
if (!this.isContained()) {
user.sendPrivateText("The staff must be wielded.");
return false;
}
final StendhalRPZone zone=user.getZone();
if (zone.isInProtectionArea(user)) {
user.sendPrivateText("The aura of protection in this area lets the dead ... | Is invoked when the necromancer staff is used. |
public CreatureRespawnPoint(final StendhalRPZone zone,final int x,final int y,final Creature creature,final int maximum){
this.zone=zone;
this.x=x;
this.y=y;
this.prototypeCreature=creature;
this.maximum=maximum;
this.respawnTime=creature.getRespawnTime();
this.creatures=new LinkedList<Creature>();
resp... | Creates a new RespawnPoint. |
public void stateChanged(ChangeEvent e){
if (settingColor) {
return;
}
Color color=getColor();
if (e.getSource() == hueSpinner) {
setHue(((Number)hueSpinner.getValue()).floatValue() / 360,false);
}
else if (e.getSource() == saturationSpinner) {
setSaturation(((Number)saturationSpinner.getValue(... | ChangeListener method, updates the necessary display widgets. |
public Feature(String name,Object value,boolean isDefaultValue){
this.name=FeatureUtil.escapeFeatureName(name).intern();
this.value=value;
this.isDefaultValue=isDefaultValue;
}
| Creates a feature that is aware if the value is a <b>default value</b>. This information is used when filling the feature store. A sparse feature store would not add a feature if it is a default value i.e. means a feature is <i>not set</i> |
public static void doEntryOperations() throws Exception {
Region r1=cache.getRegion(Region.SEPARATOR + REGION_NAME);
String keyPrefix="server-";
for (int i=0; i < 10; i++) {
r1.put(keyPrefix + i,keyPrefix + "val-" + i);
}
}
| Do some PUT operations |
public Transit createNewTransit(String userName){
boolean found=false;
String testName="";
Transit z;
while (!found) {
int nextAutoTransitRef=lastAutoTransitRef + 1;
testName="IZ" + nextAutoTransitRef;
z=getBySystemName(testName);
if (z == null) {
found=true;
}
lastAutoTransitRef=n... | For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username. Note: Since system names should be kept short for use in Dispatcher, the :AUTO:000 has been removed from automatically generated system names. Autogenerated system names will use IZnn, where nn is the fi... |
protected static <A extends Annotation,T>Set<PersistentResource<T>> filter(Class<A> permission,Set<PersistentResource<T>> resources,boolean skipNew){
Set<PersistentResource<T>> filteredSet=new LinkedHashSet<>();
for ( PersistentResource<T> resource : resources) {
PermissionExecutor permissionExecutor=resource.... | Filter a set of PersistentResources. |
public void initialize(final String componentFolder) throws IOException, RequiredInputMissingException {
if (StringUtils.isBlank(componentFolder)) throw new RequiredInputMissingException("Missing required value for parameter 'componentFolder'");
File folder=new File(componentFolder);
if (!folder.isDirectory()) ... | Initializes the class loader by pointing it to folder holding managed JAR files |
public void clearSelection(){
List<CalendarDay> dates=getSelectedDates();
adapter.clearSelections();
for ( CalendarDay day : dates) {
dispatchOnDateSelected(day,false);
}
}
| Clear the currently selected date(s) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.