code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
private static Map<Integer,Collection<JsonArrayEntry>> groupJsonEntryByInstanceId(Collection<JsonArrayEntry> jsonEntries,LwM2mPath baseName) throws InvalidValueException {
Map<Integer,Collection<JsonArrayEntry>> result=new HashMap<>();
for ( JsonArrayEntry e : jsonEntries) {
LwM2mPath nodePath=baseName.append(... | Group all JsonArrayEntry by instanceId |
public void releasePreparedStatement(PreparedStatement stmt){
if (stmt == null) return;
String sqlCommand=stmt.toString();
try {
stmt.clearParameters();
}
catch ( SQLException e) {
s_dbEngine.setDBError(true);
s_logger.log(Level.SEVERE,this.getClass().getSimpleName(),Thread.currentThread().getSt... | release a prepared statement |
public void actionPerformed(ActionEvent e){
if (!(table.getModel() instanceof GridTable)) {
if (CLogMgt.isLevelFine()) log.fine("Not supported - " + table.getModel());
return;
}
boolean isCopy=CMD_Copy.equals(e.getActionCommand());
boolean isCopyWithHeaders=CMD_CopyWithHeaders.equals(e.getActionComm... | This method is activated on the Keystrokes we are listening to in this implementation. Here it listens for Copy and Paste ActionCommands. |
public Links mapLinks(JSONObject linksJsonObject){
Links links=new Links();
try {
links.setSelfLink(linksJsonObject.getString("self"));
}
catch ( JSONException e) {
Logger.debug("JSON link does not contain self");
}
try {
links.setRelated(linksJsonObject.getString("related"));
}
catch ( JSON... | Will map links and return them. |
public BigDecimal sum(String sqlExpression){
return aggregate(sqlExpression,AGGREGATE_SUM);
}
| SUM sqlExpression for items that match query criteria |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:54.222 -0400",hash_original_method="EF52791FB2EBE48A20094079DA1FF6E8",hash_generated_method="E2B56403E9FE6193D82142D0B0640FED") public static boolean contentEqualsIgnoreEOL(Reader input1,Reader input2) throws IOException {
Buffere... | Compare the contents of two Readers to determine if they are equal or not, ignoring EOL characters. <p> This method buffers the input internally using <code>BufferedReader</code> if they are not already buffered. |
public SegmentedButtonPainter(Which state,PaintContext ctx){
super(state,ctx);
type=getButtonType(state);
}
| Create a segmented button painter. |
public DefaultEntityViewInfo createDefaultInfo(){
DefaultEntityViewInfo result=null;
try {
result=(DefaultEntityViewInfo)DEFAULT_INFO.clone();
}
catch ( CloneNotSupportedException e) {
e.printStackTrace();
}
return result;
}
| Creates an entity view info with default values. |
public static void requiredAttributes(SimpleMethod method,Element element,String... attributeNames) throws ValidationException {
for ( String name : attributeNames) {
String attributeValue=element.getAttribute(name);
if (attributeValue.length() == 0) {
handleError("Required attribute \"" + name + "\" i... | Tests <code>element</code> for required attributes. |
@Override protected void onPreExecute(){
super.onPreExecute();
pDialog=new ProgressDialog(fa);
pDialog.setTitle("Downloading");
pDialog.setMessage("Please wait...");
pDialog.setIndeterminate(false);
pDialog.setMax(100);
pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pDialog.setCancelable(tru... | Before starting background thread Show Progress Bar Dialog |
private static Collection<Employee> employees(){
Collection<Employee> employees=new ArrayList<>();
employees.add(new Employee("James Wilson",12500,new Address("1096 Eddy Street, San Francisco, CA",94109),Arrays.asList("Human Resources","Customer Service")));
employees.add(new Employee("Daniel Adams",11000,new Add... | Creates collection of employees. |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
public void write(OutputNode node,Object source) throws Exception {
Collection list=(Collection)source;
OutputNode parent=node.getParent();
if (!node.isCommitted()) {
node.remove();
}
write(parent,list);
}
| This <code>write</code> method will write the specified object to the given XML element as as list entries. Each entry within the given collection must be assignable from the annotated type specified within the <code>ElementList</code> annotation. Each entry is serialized as a root element, that is, its <code>Root</co... |
@Nullable @CheckReturnValue private List<Ticket> tryAcquireAtomically(int tickets) throws NoCapacityAvailableException {
List<Ticket> acquiredParentTickets=new ArrayList<>();
mLock.lock();
try {
if (tickets > mCapacity) {
throw new NoCapacityAvailableException();
}
if (mParentTickets.size() >= t... | Atomically attempt to remove the necessary number of tickets. This must be an all-or-nothing attempt to avoid multiple acquire() calls from deadlocking by each partially acquiring the necessary number of tickets. |
public static boolean isSignedBy(PGPPublicKey pubKey,PGPPublicKey signerPubKey){
PGPSignature sig=getSignatures(pubKey).get(signerPubKey.getKeyID());
return sig != null && (sig.getSignatureType() == PGPSignature.DEFAULT_CERTIFICATION || sig.getSignatureType() == PGPSignature.DIRECT_KEY);
}
| Checks if publicKey is signed by signerPublicKey, without any verification. In future we have to review carefully the PGP Specs and implement the verification. See also: http://osdir.com/ml/encryption.bouncy-castle.devel/2006-12/msg00005.html |
public static void print(String s1,String s2){
print(s1);
print(s2);
}
| Prints two strings to System.out without a newline |
public static void main(String[] args){
Scanner input=new Scanner(System.in);
System.out.print("Enter an integer: ");
int number=input.nextInt();
System.out.println(number + (isPalindrome(number) ? " is " : " is not ") + "a palindrome.");
}
| Main Method |
@Override protected void reset(){
}
| Override the reset method so we do nothing. |
public static CommandResult execCommand(String command,boolean isRoot){
return execCommand(new String[]{command},isRoot,true);
}
| execute shell command, default return result msg |
public static final SandboxRay show(Window owner){
AddRayDialog ard=new AddRayDialog(owner);
ard.setLocationRelativeTo(owner);
ard.setVisible(true);
if (!ard.canceled) {
synchronized (AddRayDialog.class) {
N++;
}
return ard.rayPanel.getRay();
}
return null;
}
| Shows a dialog used to accept input for adding a ray to the world. <p> Returns null if the dialog is closed or canceled. |
public static Map cloneMapValues(Map source){
ParamChecks.nullNotPermitted(source,"source");
Map result=new HashMap();
for ( Object key : source.keySet()) {
Object value=source.get(key);
if (value != null) {
try {
result.put(key,ObjectUtilities.clone(value));
}
catch ( CloneNotS... | Returns a new map that contains the same keys and cloned copied of the values. |
public GroupFileTransferDeleteTask(FileTransferServiceImpl fileTransferService,InstantMessagingService imService,LocalContentResolver contentResolver,String chatId,String transferId){
super(contentResolver,FileTransferData.CONTENT_URI,FileTransferData.KEY_FT_ID,FileTransferData.KEY_CHAT_ID,null,transferId);
mFileTr... | Deletion of a specific file transfer. |
private static Field findAccessibleField(Class clas,String fieldName) throws UtilEvalError, NoSuchFieldException {
Field field;
try {
field=clas.getField(fieldName);
ReflectManager.RMSetAccessible(field);
return field;
}
catch ( NoSuchFieldException e) {
}
while (clas != null) {
try {
... | Used when accessibility capability is available to locate an occurrence of the field in the most derived class or superclass and set its accessibility flag. Note that this method is not needed in the simple non accessible case because we don't have to hunt for fields. Note that classes may declare overlapping private ... |
public void drawDomainMarker(Graphics2D g2,ContourPlot plot,ValueAxis domainAxis,Marker marker,Rectangle2D dataArea){
if (marker instanceof ValueMarker) {
ValueMarker vm=(ValueMarker)marker;
double value=vm.getValue();
Range range=domainAxis.getRange();
if (!range.contains(value)) {
return;
... | Draws a vertical line on the chart to represent a 'range marker'. |
private static TextArea findTextAreaText(Container root,String text){
int count=root.getComponentCount();
for (int iter=0; iter < count; iter++) {
Component c=root.getComponentAt(iter);
if (c instanceof TextArea) {
String n=((TextArea)c).getText();
if (n != null && n.equals(text)) {
retu... | Finds a component with the given name, works even with UI's that weren't created with the GUI builder |
public boolean containsPoint(float x,float y){
return isPointInTriangle(x,y,p1,p2,p3) || isPointInTriangle(x,y,p1,p3,p4);
}
| Determines if the quadrilateral contains the given point. This does not work if the quadrilateral is self-intersecting or if any inner angle is reflex (greater than 180 degrees). |
BCRSAPrivateCrtKey(RSAPrivateCrtKeyParameters key){
super(key);
this.publicExponent=key.getPublicExponent();
this.primeP=key.getP();
this.primeQ=key.getQ();
this.primeExponentP=key.getDP();
this.primeExponentQ=key.getDQ();
this.crtCoefficient=key.getQInv();
}
| construct a private key from it's org.bouncycastle.crypto equivalent. |
public boolean isInstanceOf(Object obj,Class<?> clz){
if (obj == null || clz == null) {
if (log.isLoggable(Level.FINEST)) {
log.finest("isInstanceOf error: obj=" + obj + " clz="+ clz);
}
return false;
}
return clz.isAssignableFrom(obj.getClass());
}
| This method determines whether the supplied object is an instance of the supplied class/interface. |
private void updateHelp(){
if (combinedNeuronInfoPanel.getUpdateRulePanel().getCbNeuronType().getSelectedItem() == SimbrainConstants.NULL_STRING) {
helpAction=new ShowHelpAction("Pages/Network/neuron.html");
}
else {
String name=(String)combinedNeuronInfoPanel.getUpdateRulePanel().getCbNeuronType().getSele... | Set the help page based on the currently selected neuron type. |
private StatisticDescriptorImpl(String name,byte typeCode,String description,String unit,boolean isCounter,boolean isLargerBetter){
this.name=name;
this.typeCode=typeCode;
if (description == null) {
this.description="";
}
else {
this.description=description;
}
if (unit == null) {
this.unit="";
... | Creates a new description of a statistic. |
public void calculateAngles(){
float totalAngle=360.0f;
float delta=totalAngle / values.size();
float angle=0.0f;
angles=new double[values.size()];
for (int i=0; i < angles.length; i++) {
angles[i]=angle;
angle+=delta;
}
}
| Calculates the angles. |
private void validateVMaxThinVolumePreAllocateParam(String provisionType,String systemType,Integer thinVolumePreAllocationPercentage){
if (!VirtualPool.ProvisioningType.Thin.toString().equalsIgnoreCase(provisionType) && thinVolumePreAllocationPercentage > 0) {
throw APIException.badRequests.thinVolumePreallocatio... | Validates VMAX Thin volume preallocate param. |
public OperationNotSupportException(String arg0,Throwable arg1){
super(arg0,arg1);
}
| Creates a new instance of OperationNotSupportException. |
public static void checkNeedForCastCast(BlockScope scope,CastExpression enclosingCast){
if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore) {
return;
}
CastExpression nestedCast=(CastExpression)enclosingCast.expression;
if ((nestedCast.bits & ASTNode.Un... | Complain if cast expression is cast, but not actually needed, int i = (int)(Integer) 12; Note that this (int) cast is however needed: Integer i = 0; char c = (char)((int) i); |
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
key=key.clone();
}
| readObject is called to restore the state of this key from a stream. |
public boolean hasOutputEventEdge(Edge e){
return outputEvents.containsKey(e);
}
| Does the rcfg node contain an output event for the given edge |
private void userAction(int action,User user) throws SQLException, IOException {
try (FbService service=attachServiceManager()){
ServiceRequestBuffer srb=getUserSRB(service,action,user);
setSecurityDatabaseArgument(srb);
executeServicesOperation(service,srb);
}
}
| Perform the specified action. |
public IllegalConfigurationValueException(String message){
super(message);
}
| Create a new IllegalConfigurationValueException. |
private void disposePreviousContent(){
for ( final Control c : this.getChildren()) {
c.dispose();
}
}
| Dispose the content before a redraw |
public CRFPClient(){
}
| We'll set up the connection to the server when it's needed, but not here. |
public Object decode(Object pObject) throws DecoderException {
if (pObject == null) {
return null;
}
else if (pObject instanceof byte[]) {
return decode((byte[])pObject);
}
else if (pObject instanceof String) {
return decode((String)pObject);
}
else {
throw new DecoderException("Objects o... | Decodes a URL safe object into its original form. Escaped characters are converted back to their original representation. |
BillingRun executeBilling(DataProvider dataProvider){
BillingRun result=new BillingRun(dataProvider.getPeriodStart(),dataProvider.getPeriodEnd());
for ( BillingInput billingInput : dataProvider.getBillingInput()) {
try {
BillingResult bill=revenueCalculator.performBillingRunForSubscription(billingInput);... | Execute the billing calculation for the payment preview report or for the export of billing data. |
DummyAction recordActions(ActionList list){
DummyAction da=null;
if (list != null && list.size() > 0) {
int offset=list.getOffset(0);
da=new DummyAction(list);
m_master.setActionOffset(offset,da);
}
return da;
}
| Store away the ActionLists for later retrieval |
protected ObjectFactory2D(){
}
| Makes this class non instantiable, but still let's others inherit from it. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node employeeNode;
NodeList childList;
Node oldChild;
Node newChild;
Node child;
String childName;
Node replacedNode;
doc=(Document)load("staff",true);
elementList=doc.getElementsByTagName("employee");
employeeNode=elem... | Runs the test case. |
public final void debug(final String message){
if (isDebugEnabled()) {
output(Priority.DEBUG,message,null);
}
}
| Log a debug priority event. |
public NPrism(int sides,double radiusTop,double radiusBase,double height){
this(sides,radiusTop,radiusBase,0.0,height,true);
}
| Creates a frustum like prism. |
private synchronized void writeXMLFile(){
try {
Source source=new DOMSource(doc);
Result result=new StreamResult(requestFile);
Transformer xformer=TransformerFactory.newInstance().newTransformer();
xformer.transform(source,result);
}
catch ( TransformerConfigurationException e) {
e.printStackT... | Writes the "account-requests" data to an XML file |
public static void main(String[] args){
JFrame frame=new ConnectFourApp().constructApplicationFrame();
frame.setSize(450,450);
frame.setVisible(true);
}
| Application starter. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case TypesPackage.TYPE__ANNOTATIONS:
return annotations != null && !annotations.isEmpty();
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void layoutNetwork(){
NetworkLayoutManager.offsetNeuronGroup(inputLayer,som,Direction.NORTH,250);
}
| Set the layout of the network. |
final public VarNode sid(){
return (VarNode)getProperty(Annotations.SID);
}
| The statement identifier variable for triples which match this statement pattern (optional). The statement identifier is the composition of the (subject, predicate, and object) positions of the matched statements. |
public Word loadWord(Offset offset){
return null;
}
| Loads a word value from the memory location pointed to by the current instance. |
public void testSyncFailedDialog_SettingsButtonLoadsSettings(){
expectVisible(viewWithText(R.string.sync_failed_settings));
App.getInstance().getUserManager().setAutoCancelEnabled(false);
click(viewWithText(R.string.sync_failed_settings));
expectVisible(viewWithText(R.string.pref_title_server));
}
| Tests that clicking 'Settings' in sync failed dialog loads settings activity. |
public int entryPoint(State state){
int pc=curCP();
alive=true;
State newState=state.dup();
setDefined(newState.defined);
this.state=newState;
Assert.check(state.stacksize <= max_stack);
if (debugCode) System.err.println("entry point " + state);
pendingStackMap=needStackMap;
return pc;
}
| Declare an entry point with initial state; return current code pointer |
protected TLCError createError(TLCRegion tlcRegion,String message){
TLCError topError=new TLCError();
if (tlcRegion instanceof TLCRegionContainer) {
TLCRegionContainer container=(TLCRegionContainer)tlcRegion;
ITypedRegion[] regions=container.getSubRegions();
Assert.isTrue(regions.length < 3,"Unexpected ... | Creates an error object <br>This is a factory method |
private String determineLastKnownUrl(){
int tabId=determineTabId();
String url=mTabModel.getCurrentUrlForDocument(tabId);
if (TextUtils.isEmpty(url)) url=determineInitialUrl(tabId);
return url;
}
| Determine the last known URL that this Document was displaying when it was stopped. |
public String forceGetValueAsString(){
if (mValue == null) {
return "";
}
else if (mValue instanceof byte[]) {
if (mDataType == TYPE_ASCII) {
return new String((byte[])mValue,US_ASCII);
}
else {
return Arrays.toString((byte[])mValue);
}
}
else if (mValue instanceof long[]) {
... | Gets a string representation of the value. |
public boolean isUpdateReferences(){
return fUpdateReferences;
}
| Returns if move will also update references |
static void loadLibraryWithPath(String libName,ClassLoader loader,String libraryPath){
throw new Error("TODO - no reference DRLVM code");
}
| This method must be provided by the VM vendor, as it is called by java.lang.System.load(). System.load() cannot call Runtime.load() because the library is loaded using the ClassLoader of the calling method. Loads and links the library specified by the argument. No security check is done. |
public static void logFixedPointGeometry(String label,Geometry fixedPointGeometry){
if (fixedPointGeometry == null) {
LOG.info("{} is null.",label);
}
else if (fixedPointGeometry.isEmpty()) {
LOG.info("{} is empty.",label);
}
else {
String geoJson=new GeometryJSON().toString(fixedDegreeGeometryToF... | Given a JTS Geometry in fixed-point latitude and longitude, log it as floating-point GeoJSON. |
@PostLoad public void postLoad(){
loadLazy();
}
| After load, the saved password is copied to the transient one. The transient one can be overridden by the application to force a password change. |
public RuleDefinitionsJson savePipelineRules(String pipelineName,RuleDefinitionsJson pipeline,String rev) throws ApiException {
Object postBody=pipeline;
byte[] postBinaryBody=null;
if (pipelineName == null) {
throw new ApiException(400,"Missing the required parameter 'pipelineName' when calling savePipelineR... | Update an existing Pipeline Rules by name |
public static double min(double[] a,int lo,int hi){
if (lo < 0 || hi >= a.length || lo > hi) throw new IndexOutOfBoundsException("Subarray indices out of bounds");
double min=Double.POSITIVE_INFINITY;
for (int i=lo; i <= hi; i++) {
if (Double.isNaN(a[i])) return Double.NaN;
if (a[i] < min) min=a... | Returns the minimum value in the specified subarray. |
public BaseMessage(final long id,final String topic){
this(MessageIdGenerator.getNewId(),topic,null,new Date());
}
| Creates a BaseMessage from the given parameters. |
public static int printDocumentMonospacedWordWrap(Graphics g,Document doc,int fontSize,int pageIndex,PageFormat pageFormat,int tabSize){
g.setColor(Color.BLACK);
g.setFont(new Font("Monospaced",Font.PLAIN,fontSize));
tabSizeInSpaces=tabSize;
fm=g.getFontMetrics();
int fontWidth=fm.charWidth('w');
int fontHe... | Prints a <code>Document</code> using a monospaced font, word wrapping on the characters ' ', '\t', '\n', ',', '.', and ';'. This method is expected to be called from Printable 'print(Graphics g)' functions. |
public void deleteAt(int index){
if (index < 0 || index > this.size) {
return;
}
if (index < this.head.getArr().length) {
int[] arr=this.head.getArr();
int[] newArr=new int[arr.length - 1];
int j=0;
for (int i=0; i < arr.length; i++) {
if (i == index) continue;
newArr[j++]=ar... | The strategy for "delete" is similar to that of "get" with one small change - we want to stay one node behind the node that contains the actual value. This is so that if we are deleting the only value of a node, we can remove the node entirely. i.e. [1, 2, 5] -> [6] -> [8, 3, 5] To delete index 3 (value of 6), we would... |
private void updateProgress(String progressLabel,int progress){
if (myHost != null) {
myHost.updateProgress(progressLabel,progress);
}
else {
System.out.println(progressLabel + " " + progress+ "%");
}
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
@Override public boolean isRasterFormat(){
return true;
}
| Used to check if the file is raster format. |
public CAddressSpaceNodeComponent(final JTree projectTree,final IDatabase database,final INaviProject project,final INaviAddressSpace addressSpace){
super(new BorderLayout());
Preconditions.checkNotNull(database,"IE01948: Database argument can not be null");
Preconditions.checkNotNull(project,"IE01949: Project ar... | Creates a new address space component. |
public void clear(){
for ( OutputStream stream : streams.keySet()) {
remove(stream);
}
}
| Removes all streams from logging. |
public void enableCurlLogging(String name,int level){
if (name == null) {
throw new NullPointerException("name");
}
if (level < Log.VERBOSE || level > Log.ASSERT) {
throw new IllegalArgumentException("Level is out of range [" + Log.VERBOSE + ".."+ Log.ASSERT+ "]");
}
curlConfiguration=new LoggingConfi... | Enables cURL request logging for this client. |
public void resetNewMessageCount(){
int oldValue=newMessages;
newMessages=0;
firePropertyChange("messages",oldValue,newMessages);
}
| reset the counter of new messages |
public static boolean isEmpty(String s){
if (s == null) {
return true;
}
return s.equals("");
}
| Checks if a String is empty or null. |
public static void init(){
Logger rootLogger=Logger.getRootLogger();
EclipseLogAppender eclipseAppender=new EclipseLogAppender();
eclipseAppender.setName("eclipse");
rootLogger.addAppender(eclipseAppender);
eclipseAppender.setLayout(new PatternLayout("%c %x - %m%n"));
Logger eclipseAppenderLogger=Logger.get... | Initializes the log4j logging with an additional appender which routes the logging to the Eclipse ErrorView. |
public T caseDisplayColor_(DisplayColor_ object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Display Color </em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
private Node createForIn(int declType,Node loop,Node lhs,Node obj,Node body,boolean isForEach){
int destructuring=-1;
int destructuringLen=0;
Node lvalue;
int type=lhs.getType();
if (type == Token.VAR || type == Token.LET) {
Node kid=lhs.getLastChild();
int kidType=kid.getType();
if (kidType == To... | Generate IR for a for..in loop. |
public static void postInit(Properties properties){
}
| Override the default SystemProperties code; insert the command-line arguments. <p> The following are set by the "runrvm" script before we go into the C bootloader, by passing them as command-line args with the -D flag: <p> os.name, os.arch, os.version user.name, user.home, user.dir gnu.classpath.vm.shortname, gnu.class... |
public void invert(){
this.inverted=!this.inverted;
}
| Inverts this matcher, that is, inverts the result that is returned from the matching methods. |
public void writeOdMatrixToCsv(String filename,DenseDoubleMatrix2D odMatrix){
log.info("Writing OD matrix travel time to " + filename);
int nullcounter=0;
try {
BufferedWriter output=IOUtils.getBufferedWriter(filename);
try {
output.write("fromZone,toZone,carTime");
output.newLine();
int... | Writes the private car travel time (in seconds) to a comma-separated flat file. |
public boolean preservePositionIncrements(){
return preservePositionIncrements;
}
| Returns true if position increments are preserved when converting the token stream to an automaton |
int[] findNearestArea(int pixelX,int pixelY,int spanX,int spanY,int[] result){
return findNearestArea(pixelX,pixelY,spanX,spanY,null,false,result);
}
| Find a starting cell position that will fit the given bounds nearest the requested cell location. Uses Euclidean distance to score multiple vacant areas. |
public ScaledVector(double scale,Vec base){
this.scale=scale;
this.base=base;
}
| Creates a new scaled vector |
public boolean addList(final String name){
boolean ret=false;
if (!names.containsKey(name)) {
names.put(name,listCount);
entries.add(new LinkedList<String>());
properties.add(new HashMap<String,String>());
currentEntries=entries.get(listCount);
currentProperties=properties.get(listCount);
li... | Adds a new list if a list by that name does not exist yet. |
public static List<String> readFileToList(String filePath){
File file=new File(filePath);
List<String> fileContent=new ArrayList<String>();
if (file == null || !file.isFile()) {
return null;
}
BufferedReader reader=null;
try {
reader=new BufferedReader(new FileReader(file));
String line=null;
... | read file to string list, a element of list is a line |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static Element firstChildElement(Element element,String... childElementNames){
return firstChildElement(element,UtilMisc.toSetArray(childElementNames));
}
| Return the first child Element returns the first element. |
protected SquareTerrain(int divisions,double[][] terrain,Vector3[][] normals,double[][] temperature,double xScale,double zScale){
mDivisions=divisions;
mTerrain=terrain;
mTemperature=temperature;
mNormals=normals;
mXScale=xScale;
mZScale=zScale;
mOneOverXScale=1 / xScale;
mOneOverZScale=1 / zScale;
fo... | Represents a Square Terrain centered at the center |
public void findAndUndo(Object someObj){
navPanel.findAndUndo(someObj);
zoomPanel.findAndUndo(someObj);
scaleField.findAndUndo(someObj);
}
| MapHandlerChild method. |
public void requestPasswordForShareViaLink(OCFile file,boolean createShare){
SharePasswordDialogFragment dialog=SharePasswordDialogFragment.newInstance(file,createShare);
dialog.show(mFileActivity.getSupportFragmentManager(),SharePasswordDialogFragment.PASSWORD_FRAGMENT);
}
| Starts a dialog that requests a password to the user to protect a share link. |
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:44.595 -0500",hash_original_method="9D058B55598451C1F46B788161F3861A",hash_generated_method="06F67D4C24568F09661364790AC2A7A2") public void entity(String name,int value){
theEntities.p... | Add to or replace a character entity in this schema. |
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 SubscriptionHistory(Subscription c){
super(c);
if (c.getOrganization() != null) {
setOrganizationObjKey(c.getOrganization().getKey());
}
if (c.getProduct() != null) {
setProductObjKey(c.getProduct().getKey());
}
if (c.getAsyncTempProduct() != null) {
setAsyncTempProductObjKey(Long.valueOf... | Constructs SubscriptionHistory from a Subscription domain object |
public double asDoubleConst(Value value){
assert isJavaConstant(value) && asJavaConstant(value).getJavaKind() == JavaKind.Double;
JavaConstant constant=asJavaConstant(value);
return constant.asDouble();
}
| Returns the double value of any constant that can be represented by a 64-bit float value. |
public int compare(Object o1,Object o2){
return comparator.compare(o1,o2);
}
| Call the comparator on the column |
public EaseInOut(){
}
| Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:15.523 -0500",hash_original_method="13ACD75B58E729F7C9E7DE6208579581",hash_generated_method="ECAD6D583B3C0FBC2F97779678F13777") public void stop(){
if (isRunning()) {
... | <p>Stops the animation. This method has no effect if the animation is not running.</p> |
final boolean putKey(V key,boolean onlyIfAbsent){
if (key == null) throw new NullPointerException();
int hash=spread(key.hashCode());
int binCount=0;
for (Node<V>[] tab=table; ; ) {
Node<V> f;
int n, i, fh;
if (tab == null || (n=tab.length) == 0) tab=initTable();
else if ((f=tabAt(tab,i=(... | Implementation for add |
public TypesEditPlugin(){
super(new ResourceLocator[]{BaseEditPlugin.INSTANCE});
}
| Create the instance. <!-- begin-user-doc --> <!-- end-user-doc --> |
@Override public Enumeration<Option> listOptions(){
Vector<Option> newVector=new Vector<Option>(3);
newVector.addElement(new Option("\tUse kernel density estimator rather than normal\n" + "\tdistribution for numeric attributes","K",0,"-K"));
newVector.addElement(new Option("\tUse supervised discretization to proc... | Returns an enumeration describing the available options. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.