code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void addBackward(EdgeInfo ei){
backward.append(ei);
}
| Add the given edge into the list of backward edges. |
@SuppressWarnings("rawtypes") @Test public void testCustomStorageFormat() throws Exception {
String resourceId="/schema/test/foo";
String storedResourceId="_schema_test_foo.bin";
MockAnalysisComponent observer=new MockAnalysisComponent();
List<ManagedResourceObserver> observers=Arrays.asList((ManagedResourceObs... | The ManagedResource storage framework allows the end developer to use a different storage format other than JSON, as demonstrated by this test. |
public AccountHeaderBuilder withHeaderBackground(Drawable headerBackground){
this.mHeaderBackground=new ImageHolder(headerBackground);
return this;
}
| set the background for the slider as color |
public E removeFirst(){
final Node<E> f=first;
if (f == null) throw new NoSuchElementException();
return unlinkFirst(f);
}
| Removes and returns the first element from this list. |
public void testPropertyFileLoading() throws Exception {
File propFile=File.createTempFile("propertyLoadTest",".properties");
PrintWriter pw=new PrintWriter(propFile);
pw.println("a=");
pw.println("a1= ");
pw.println("b=foo");
pw.println("b1= foo ");
pw.close();
FileInputStream fis=new FileInputStre... | Ensure that Java property files are correctly loaded from a property file. This includes Java conventions that leading whitespace before the property value is consumed, but trailing whitespace is not. |
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. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:41.303 -0500",hash_original_method="61CB88820073366C14C36F5A2569814F",hash_generated_method="7D268822285759A7379C078F51F43CDF") public static final String readMagic(DataInputStream in){
try {
byte[] bytes=new byte[512];
fo... | Returns the file's magic value as a String if found, otherwise null. |
public void testRegister1(){
Phaser phaser=new Phaser();
assertState(phaser,0,0,0);
assertEquals(0,phaser.register());
assertState(phaser,0,1,1);
}
| register() will increment the number of unarrived parties by one and not affect its arrived parties |
public Matrix4f rotateZ(float ang){
return rotateZ(ang,this);
}
| Apply rotation about the Z axis to this matrix by rotating the given amount of radians. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-ha... |
public void test_ConstructorIILjava_util_Random(){
BigInteger bi1=new BigInteger(10,5,rand);
BigInteger bi2=new BigInteger(10,5,rand);
assertTrue(bi1 + " is negative",bi1.compareTo(BigInteger.ZERO) >= 0);
assertTrue(bi1 + " is too big",bi1.compareTo(new BigInteger("1024",10)) < 0);
assertTrue(bi2 + " is negat... | java.math.BigInteger#BigInteger(int, int, java.util.Random) |
public static String toHex(byte[] bytes){
char[] hexChars=new char[bytes.length * 2];
int v;
for (int j=0; j < bytes.length; j++) {
v=bytes[j] & 0xFF;
hexChars[j * 2]=hexArray[v >>> 4];
hexChars[j * 2 + 1]=hexArray[v & 0x0F];
}
return new String(hexChars);
}
| Bytes to hex |
public void testMoveRenameFileDestinationRootSourceMissing() throws Exception {
IgfsPath file=new IgfsPath("/" + FILE.name());
create(igfsSecondary,paths(DIR,SUBDIR),paths(FILE));
create(igfs,null,null);
igfs.rename(FILE,file);
checkExist(igfs,DIR,SUBDIR);
checkExist(igfs,igfsSecondary,file);
checkNotExis... | Test file move and rename when destination is the root and source is missing. |
public void stop(){
CGlobalProgressManager.instance().remove(this);
}
| Stops the load operation. |
@Override public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException {
UpdateResponse ur=null;
if (this.solr0 != null) ur=this.solr0.deleteById(ids);
if (this.solr1 != null) ur=this.solr1.deleteById(ids);
return ur;
}
| Deletes a list of documents by unique ID |
public static SortedDocValues wrap(SortedSetDocValues sortedSet,Type selector){
if (sortedSet.getValueCount() >= Integer.MAX_VALUE) {
throw new UnsupportedOperationException("fields containing more than " + (Integer.MAX_VALUE - 1) + " unique terms are unsupported");
}
SortedDocValues singleton=DocValues.unwra... | Wraps a multi-valued SortedSetDocValues as a single-valued view, using the specified selector |
public String country(){
return country;
}
| Returns the country name or abbreviation (example: 'DE' for Germany). |
@Override public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException {
try {
MBeanServer server=QueryEval.getMBeanServer();
String v=server.getObjectInstance(name).getClassName();
if (v.equals(classNam... | Applies the QualifiedAttributeValueExp to an MBean. |
public void add(R record){
records.add(record);
lastRecord=record;
currentSizeBytes+=record.lengthWithOverhead();
if (timestamp < 0) {
timestamp=System.currentTimeMillis();
}
}
| Adds a record to the buffer. |
public JPAProperty(JPAProperty property){
this(property.getNamespace(),property.getLocalName(),property.getValue(),property.getOrder());
}
| Create a copy of the give JPAProperty |
public static void assertSearcherHasChanged(SolrIndexSearcher previous){
SolrQueryRequest req=req("*:*");
try {
SolrIndexSearcher newSearcher=getMainSearcher(req);
assertNotSame(previous,newSearcher);
}
finally {
req.close();
}
}
| Given an existing searcher, creates a new SolrRequest, and verifies that the searcher in that request is <b>not</b> the same as the previous searcher -- cleaningly closing the new SolrRequest either way. |
public void inputSentence(String text,String subject,String userName,String targetUserName,Message message,Network network) throws MessagingException {
Vertex input=createInputParagraph(text.trim(),network);
Vertex user=network.createSpeaker(userName);
input.addRelationship(Primitive.INSTANTIATION,Primitive.EMAIL... | Process the text sentence. |
public int addPadding(byte[] in,int inOff){
int count=in.length - inOff;
byte code;
if (inOff > 0) {
code=(byte)((in[inOff - 1] & 0x01) == 0 ? 0xff : 0x00);
}
else {
code=(byte)((in[in.length - 1] & 0x01) == 0 ? 0xff : 0x00);
}
while (inOff < in.length) {
in[inOff]=code;
inOff++;
}
retu... | add the pad bytes to the passed in block, returning the number of bytes added. <p> Note: this assumes that the last block of plain text is always passed to it inside in. i.e. if inOff is zero, indicating the entire block is to be overwritten with padding the value of in should be the same as the last block of plain te... |
public boolean isReverseAxes(){
return m_iterator.isReverse();
}
| Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes. |
public boolean shouldShowRequestPermissionRationale(Fragment fragment,String... permissions){
for ( String permission : permissions) {
if (FragmentCompat.shouldShowRequestPermissionRationale(fragment,permission)) {
return true;
}
}
return false;
}
| Checks given permissions are needed to show rationale. |
public boolean canLoadArchive(AcsAccessObject acs,int archId,String entidad) throws Exception {
boolean can=false;
DbConnection dbConn=new DbConnection();
try {
dbConn.open(DBSessionManager.getSession());
can=ArchiveManager.canLoadArchive(dbConn,acs.getAccessToken(),archId);
return can;
}
catch ( ... | Devuelve <tt>true</tt> si el usuario tiene permisos de acceso sobre el archivador |
protected void startWorkFlow(int AD_Workflow_ID){
centerPane.setSelectedIndex(m_tabWorkflow);
wfPanel.load(AD_Workflow_ID,false);
}
| Start Workflow Activity |
public TollAnalyzer(final String eventsFile,final double simulationEndTime,final int noOfTimeBins,final String ug){
this(eventsFile,simulationEndTime,noOfTimeBins,null,null,ug);
}
| User group filtering will be used, result will include all links but persons from given user group only. |
public final boolean peekOrTrue(){
return (m_index > -1) ? m_values[m_index] : true;
}
| Looks at the object at the top of this stack without removing it from the stack. If the stack is empty, it returns true. |
public void validate(final Cookie cookie,final CookieOrigin origin) throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
}
if (cookie instanceof SetCookie2) {
if (cookie instanceof ClientCookie && !((ClientCookie)cookie).containsAttribute(Cl... | validate cookie version attribute. Version attribute is REQUIRED. |
public InstanceEvent(Object source,Instances structure){
super(source);
m_structure=structure;
m_status=FORMAT_AVAILABLE;
}
| Creates a new <code>InstanceEvent</code> instance which encapsulates header information only. |
public void testFilteredClassifier(){
try {
Instances data=getFilteredClassifierData();
for (int i=0; i < data.numAttributes(); i++) {
if (data.classIndex() == i) continue;
if (data.attribute(i).isNominal()) {
((SwapValues)m_FilteredClassifier.getFilter()).setAttributeIndex("" + (i +... | tests the filter in conjunction with the FilteredClassifier |
private long factorial(long num){
assert num > 0;
if (num == 1) return num;
return num * factorial(num - 1);
}
| Calculates factorial. |
public static TypesTreeModel createEmptyTypeModel(){
return new TypesTreeModel();
}
| Creates a new instance of the types tree model that doesn't contain any nodes. |
public static String dumpAsString(Object obj,boolean verbose){
StringBuffer buf=new StringBuffer();
if (obj instanceof ASN1Primitive) {
_dumpAsString("",verbose,(ASN1Primitive)obj,buf);
}
else if (obj instanceof ASN1Encodable) {
_dumpAsString("",verbose,((ASN1Encodable)obj).toASN1Primitive(),buf);
}
... | Dump out the object as a string. |
public boolean removeArg(final BOp arg){
if (arg == null) throw new IllegalArgumentException();
if (arg == this) throw new IllegalArgumentException();
if (args.remove(arg)) {
mutation();
return true;
}
return false;
}
| Remove the 1st occurrence of the argument (core mutation method). |
public Asn1Exception(String message,Throwable causeThrowable){
super(message,causeThrowable);
}
| Creates a new Asn1Exception with the specified message and cause throwable. |
public void initComponents() throws Exception {
super.initComponents();
addHelpMenu("package.jmri.jmrix.sprog.update.SprogIIUpdateFrame",true);
_memo.getSprogVersionQuery().requestVersion(this);
}
| Set the help item |
public int read() throws IOException {
if (ostart >= ofinish) {
int i=0;
while (i == 0) i=getMoreData();
if (i == -1) return -1;
}
return ((int)obuffer[ostart++] & 0xff);
}
| Reads the next byte of data from this input stream. The value byte is returned as an <code>int</code> in the range <code>0</code> to <code>255</code>. If no byte is available because the end of the stream has been reached, the value <code>-1</code> is returned. This method blocks until input data is available, the end ... |
public boolean isLastExpanded(){
return lastExpanded;
}
| Gets last expanded. |
@Override public void characters(char[] text,int start,int len) throws SAXException {
if (curHandler != null) {
if (unrecognizedElements == 0) {
if (curHandler.buffer == null) {
curHandler.buffer=new StringBuffer();
}
curHandler.buffer.append(text,start,len);
}
if (curHandler.inn... | SAX callback. |
public double optDouble(int index,double defaultValue){
try {
return getDouble(index);
}
catch ( Exception e) {
return defaultValue;
}
}
| Get the optional double value associated with an index. The defaultValue is returned if there is unknown value for the index, or if the value is not a number and cannot be converted to a number. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-01-27 09:54:12.413 -0500",hash_original_method="43C05B8A0FF5CBFFF8E027DF94B104CB",hash_generated_method="BEA9506A49791E09E851664F93E1DBF1") public void clear(){
int n=mSize;
Object[] values=mValues;
for (int i=0; i < n; i++) {
values[... | Removes all key-value mappings from this SparseArray. |
public static String toHexString(byte[] buf,String sep,int lineLen){
return toHexString(buf,0,buf.length,sep,lineLen);
}
| Get a text representation of a byte[] as hexadecimal String, where each pair of hexadecimal digits corresponds to consecutive bytes in the array. |
private void skip(){
index++;
}
| Skips the current symbol. |
private double calculateMultipleTraitsLikelihood(ContrastedTraitNode contrastNode,int traitCount){
SimpleTree contrastTree=new SimpleTree(contrastNode);
double[][] w=new double[traitCount][traitCount];
for (int j=0; j < traitCount; j++) {
for (int k=j; k < traitCount; k++) {
double wjk=0.0;
for (i... | Calculates the likelihood of the contrasted node |
public void generate(ActionEvent actionEvent){
final FileChooser fileChooser=new FileChooser();
fileChooser.setTitle("Export to");
fileChooser.getExtensionFilters().add(new ExtensionFilter(Language.JAVA.name,"*.java"));
fileChooser.getExtensionFilters().add(new ExtensionFilter(Language.CPP.name,"*.cpp"));
fil... | Controls the export button in the main menu. Opens a filechooser with language selection. The user can select the language to export to, save location and file name. |
public void sendRequests(){
Connection conn=plugin.getDb().getSQLConnection();
try (Statement st=conn.createStatement()){
for ( Entry<String,Integer> entry : plugin.getPoolsManager().getDeathHashMap().entrySet()) {
if (plugin.getDb().isPostgres()) st.execute("INSERT INTO " + plugin.getDb().getTab... | * Sends requests to the database to deal with regular events and prevent plugin from hitting server performance. Non event related categories (distances and play times) are not handled by pools. Queries must not be batched because of race conditions; a database entry must first be updated, and if cached value in HashMa... |
public boolean fillEmpties(){
return filledEmpties == null ? false : filledEmpties;
}
| If true, empty lines should still be appropriately indented. If false, empty lines should be completely blank. |
public TypeTuple apply(Substitution<ReferenceType> substitution){
List<Type> typeList=new ArrayList<>();
for ( Type type : this.list) {
Type newType=type.apply(substitution);
if (newType != null) {
typeList.add(newType);
}
else {
typeList.add(type);
}
}
return new TypeTuple(typeLis... | Applies a substitution to a type tuple, replacing any occurrences of type variables. Resulting tuple may only be partially instantiated. |
@Override protected void uninstallViewListeners(View p){
super.uninstallViewListeners(p);
Action redoActionInView=p.getActionMap().get(ID);
if (redoActionInView != null && redoActionInView != this) {
redoActionInView.removePropertyChangeListener(redoActionPropertyListener);
}
}
| Installs listeners on the view object. |
public Configurator emptyButton(int textRes,int backgroundRes){
if (textRes > 0) {
viewEmptyTryAgainButtonText=textRes;
}
if (backgroundRes > 0) {
viewEmptyTryAgainButtonBackgroundResource=backgroundRes;
}
return this;
}
| Customize the empty view button. |
public static void recordRamUsage(String measurementPoint){
List<MemoryPoolMXBean> pools=ManagementFactory.getMemoryPoolMXBeans();
if (ramPoolName.length != pools.size()) {
logger.error("Unexpected change in number of RAM areas (was " + ramPoolName.length + ", now "+ pools.size());
}
else {
for (int i=0;... | Record the RAM usage at the specified measuring point. If in a debug mode we also output to log file, otherwise just accumlate results. |
private static byte char64(char x){
if ((int)x < 0 || (int)x > index_64.length) return -1;
return index_64[(int)x];
}
| Look up the 3 bits base64-encoded by the specified character, range-checking againt conversion table |
@Override public CompilerPhase newExecution(IR ir){
return this;
}
| Return this instance of this phase. This phase contains no per-compilation instance fields. |
public File resourceDwcaFile(@NotNull String resourceName){
return dataFile(RESOURCES_DIR + "/" + resourceName+ "/"+ DWCA_FILENAME);
}
| Retrieves DwC-A file for a resource. |
public title addElement(Element element){
addElementToRegistry(element);
return (this);
}
| Adds an Element to the element. |
public void testStartViaFaster(){
Fixture f=new Fixture();
TestTimeCost tc=new TestTimeCost();
tc.setData(Id.create(1,Link.class),2.0,2.0);
tc.setData(Id.create(2,Link.class),1.0,1.0);
tc.setData(Id.create(3,Link.class),3.0,3.0);
tc.setData(Id.create(4,Link.class),2.0,2.0);
tc.setData(Id.create(5,Link.cla... | Both nodes 1 and 4 are part of the start set. Even if the path from 1 to the target leads over node 4, it may be faster, due to the intial cost values. Test that the route does not cut at node 4 as the first node backwards from the start set. |
public static final int[] quicksort(final int[] primary,final int[] secondary,final int[] names){
final int items=names.length;
final int[] primary_values=new int[items];
final int[] secondary_values=new int[items];
for (int i=0; i < items; i++) {
primary_values[i]=primary[i];
secondary_values[i]=second... | quick sort list on 2 values with names as int |
public Object read(InputNode node,Object value) throws Exception {
Class type=value.getClass();
Composite factory=getComposite(type);
Object real=factory.read(node,value);
return read(node,type,real);
}
| This <code>read</code> method will read the contents of the XML document from the provided source and populate the object with the values deserialized. This is used as a means of injecting an object with values deserialized from an XML document. If the XML source cannot be deserialized or there is a problem building th... |
public static boolean isAVPlex(StorageSystem system){
return (system.getSystemType().equals(DiscoveredDataObject.Type.vplex.name()));
}
| Determines whether or not the passed in Storage System in a VPLEX by checking the System Type. |
public boolean exceptionOccurred(){
return getException() != null;
}
| Returns whether or not an exception occurred during this async method invocation. |
public FluentTriFunction<T1,T2,T3,CompletableFuture<R>> liftAsync(final Executor ex){
return FluentFunctions.of(null);
}
| Convert this TriFunction into one that executes asynchronously and returns a CompleteableFuture with the result |
public BPTTCreationDialog(final NetworkPanel panel){
this.panel=panel;
setTitle("Build Backprop Through Time Network");
tfNumInputsOutputs.setColumns(5);
prefsPanel.addItem("Number of input / outupt nodes:",tfNumInputsOutputs);
prefsPanel.addItem("Number of hidden nodes:",tfNumHidden);
tfNumInputsOutputs.se... | Constructs a labeled item panel dialog for the creation of a simple recurrent network. |
public boolean mergeStack(Frame frame){
boolean changed=false;
if (top != frame.top) throw new RuntimeException("Operand stacks could not be merged, they are different sizes!");
for (int i=0; i < top; i++) {
if (stack[i] != null) {
Type prev=stack[i];
Type merged=prev.merge(frame.stack[i]);
... | Merges all types on the stack of this frame instance with that of the specified frame. The local variable table is left untouched. |
public Spider(PageProcessor pageProcessor){
this.pageProcessor=pageProcessor;
this.site=pageProcessor.getSite();
this.startRequests=pageProcessor.getSite().getStartRequests();
}
| create a spider with pageProcessor. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:29.178 -0500",hash_original_method="0B011E4041136408340083F55A5156B3",hash_generated_method="407F6F402D6B283873CE3DF652B88B34") public int purge(){
synchronized (impl) {
return impl.purge();
}
}
| Removes all canceled tasks from the task queue. If there are no other references on the tasks, then after this call they are free to be garbage collected. |
public boolean canGoForward(){
return pager.getCurrentItem() < (adapter.getCount() - 1);
}
| TODO should this be public? |
public static boolean lazyGaussianElimination(final int var2Eq[][],final long[] c,final int[] variable,final long[] solution){
return lazyGaussianElimination(null,var2Eq,c,variable,solution);
}
| Solves a system using lazy Gaussian elimination. |
public int costInline(int thresh,Environment env,Context ctx){
return thresh;
}
| Compute cost of inlining this statement |
public boolean equals(XObject obj2){
if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this);
try {
return m_val == obj2.bool();
}
catch ( javax.xml.transform.TransformerException te) {
throw new org.apache.xml.utils.WrappedRuntimeException(te);
}
}
| Tell if two objects are functionally equal. |
public JavaEnvironment(File javaPath){
Objects.requireNonNull(javaPath);
this.javaPath=javaPath;
}
| Creates a JavaEnvironment with the given 'java' path. |
public static void main(String[] args){
String outputFolderRunA="f:/data/experiments/parkingSearchOct2013/runs/run179/output/";
String outputFolderRunB="f:/data/experiments/parkingSearchOct2013/runs/run180/output/";
int startIteration=1200;
int endIteration=1205;
int iterationStep=10;
boolean ignoreCasesWit... | This script does the following: For two given runs, it compares for the same iteration, what percentage of parking choices are different. |
@Override public boolean execute(String action,JSONArray args,CallbackContext callbackContext){
this.callbackContext=callbackContext;
if (action.equals(ENCODE)) {
JSONObject obj=args.optJSONObject(0);
if (obj != null) {
String type=obj.optString(TYPE);
String data=obj.optString(DATA);
if (... | Executes the request. This method is called from the WebView thread. To do a non-trivial amount of work, use: cordova.getThreadPool().execute(runnable); To run on the UI thread, use: cordova.getActivity().runOnUiThread(runnable); |
private boolean needIndexConsistency(){
return _index != null && _index.needConsistency();
}
| Time UUID is required to ensure index CF and object CF consistency: both are updated in single shot - all or nothing |
public void endElement(QName element,Augmentations augs) throws XNIException {
try {
if (fDocumentHandler != null) {
fDocumentHandler.endElement(element.rawname);
}
if (fContentHandler != null) {
fAugmentations=augs;
String uri=element.uri != null ? element.uri : "";
String localpa... | The end of an element. |
public static List<Method> parseSpecMethods(List<String> strs){
LinkedList<Method> methods=new LinkedList<Method>();
for ( String str : strs) {
Method m=parseSpecMethod(str);
methods.add(m);
}
return methods;
}
| Parse a methods that are in the format an api from the spec into a Method object. |
public static Year parseYear(String s){
int y;
try {
y=Integer.parseInt(s.trim());
}
catch ( NumberFormatException e) {
throw new TimePeriodFormatException("Cannot parse string.");
}
try {
return new Year(y);
}
catch ( IllegalArgumentException e) {
throw new TimePeriodFormatException("Ye... | Parses the string argument as a year. <P> The string format is YYYY. |
public static <I0,I1,I2,I3,O>Function<tuple4<I0,I1,I2,I3>,O> Function(Class<?> theClass,String methodName,Class<?> parameterType0,Class<?> parameterType1,Class<?> parameterType2,Class<?> parameterType3){
return FunctionUtils.Function(theClass,methodName,parameterType0,parameterType1,parameterType2,parameterType3);
}
| Automagically wraps any static Java method having four input parameters of any class into xpresso's Function. |
public T caseAnonymous_concreteMethodDeclaration_2_(Anonymous_concreteMethodDeclaration_2_ object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Anonymous concrete Method Declaration 2</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
@Override public void run(){
amIActive=true;
String inputHeader=null;
boolean alphaChannelOutput=false;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for (int i=0; i < args.length; i++) {
if (i == 0) {
inputHeader=args[i];
}
else if (i == ... | Used to execute this plugin tool. |
private static boolean fileExists(String filePath){
File file=new File(filePath);
return file.exists();
}
| Check if a file exists on device |
protected ILaunchConfiguration findOrCreateLaunchConfiguration(IResource resource,String startupUrl,boolean isExternal,boolean isGwtSuperDevModeEnabled) throws CoreException, OperationCanceledException {
ILaunchConfiguration config=findLaunchConfiguration(resource,startupUrl,isExternal);
if (config == null) {
c... | Given a resource, infer the startup URL that the resource points at, then look for an existing launch configuration that points at this URL. If none exists, we'll create a new one. |
public List<String> makeKey(final Map<MetaKey,String> metaData,final boolean requireAll){
final List<String> result=new ArrayList<>(this.fields.size());
for ( final MetaKey field : this.fields) {
final String value=metaData.get(field);
if (requireAll && value == null) {
return null;
}
result.... | Make a key from the aggregator fields |
@Override public void zoomDomainAxes(double factor,PlotRenderingInfo info,Point2D source,boolean useAnchor){
for ( ValueAxis xAxis : this.domainAxes.values()) {
if (xAxis == null) {
continue;
}
if (useAnchor) {
double sourceX=source.getX();
if (this.orientation == PlotOrientation.HORIZO... | Multiplies the range on the domain axis/axes by the specified factor. |
public void testDivisionKnuth1(){
byte aBytes[]={-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
byte bBytes[]={-3,-3,-3,-3};
int aSign=1;
int bSign=1;
byte rBytes[]={0,-5,-12,-33,-96,-36,-105,-56,92,15,48,-109};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
Bi... | Verifies the case when borrow != 0 in the private divide method. |
private Object readResolve() throws ObjectStreamException {
if (this.equals(DatasetRenderingOrder.FORWARD)) {
return DatasetRenderingOrder.FORWARD;
}
else if (this.equals(DatasetRenderingOrder.REVERSE)) {
return DatasetRenderingOrder.REVERSE;
}
return null;
}
| Ensures that serialization returns the unique instances. |
protected void storeState(){
if (storePartials) {
likelihoodCore.storeState();
}
super.storeState();
}
| Stores the additional state other than model components |
public boolean isISnsDiscoverySettable(){
return iSnsDiscoverySettable;
}
| Gets the value of the iSnsDiscoverySettable property. |
protected StdTypeResolverBuilder _constructNoTypeResolverBuilder(){
return StdTypeResolverBuilder.noTypeInfoBuilder();
}
| Helper method for dealing with "no type info" marker; can't be null (as it'd be replaced by default typing) |
public CCTMXLayer layerNamed(String layerName){
if (children_ == null) return null;
for ( CCNode node : children_) {
CCTMXLayer layer=(CCTMXLayer)node;
if (layer != null) {
if (layer.layerName.equals(layerName)) return (CCTMXLayer)layer;
}
}
return null;
}
| return the TMXLayer for the specific layer |
public Matrix(int columns,double... data){
this(data,columns);
}
| Create a new matrix with a specified dataset. |
private void readUidListHeader(String line) throws IOException {
if (line == null) throw new IOException("Header entry in uid-file is null");
int gap1=line.indexOf(" ");
if (gap1 == -1) {
throw new IOException("Corrupted header entry in uid-file");
}
int version=Integer.valueOf(line.substring(0,gap1));
... | Parses the header line in uid list files. The format is: version lastUid messageCount (e.g. 1 615 273) |
public ClientMessage createMessage(){
getInternalClient();
return internalClient.createMessage(isUseDurableMessage());
}
| Create a ClientMessage If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created |
public static int compareCanonicalIntegers(String int1,String int2){
if (int1.equals(int2)) {
return 0;
}
if (int1.charAt(0) == '-' && int2.charAt(0) != '-') {
return -1;
}
if (int2.charAt(0) == '-' && int1.charAt(0) != '-') {
return 1;
}
int result=int1.length() - int2.length();
if (result ... | Compares two canonical integers to eachother. |
private boolean tag(TagData data,Body parent,boolean parseExpression) throws TemplateException {
boolean hasBody=false;
Position line=data.srcCode.getPosition();
int start=data.srcCode.getPos();
data.srcCode.next();
TagLib tagLib=nameSpace(data);
if (tagLib == null) {
data.srcCode.previous();
return... | Liest einen Tag ein, prueft hierbei ob das Tag innerhalb einer der geladenen Tag-Lib existiert, ansonsten wird ein Tag einfach als literal-string aufgenommen. <br /> EBNF:<br /> <code>name-space identifier spaces attributes ("/>" | ">" [body "</" identifier spaces ">"]);(* Ob dem Tag ein Body und ein End-Tag folgt ist... |
public BusinessObjectDataStatusEntity createBusinessObjectDataStatusEntity(String statusCode,String description,Boolean preRegistrationStatus){
BusinessObjectDataStatusEntity businessObjectDataStatusEntity=new BusinessObjectDataStatusEntity();
businessObjectDataStatusEntity.setCode(statusCode);
businessObjectData... | Creates and persists a new business object data status entity. |
public static int desaturate(int c){
int a=c & 0xff000000;
float r=((c & 0xff0000) >> 16);
float g=((c & 0x00ff00) >> 8);
float b=(c & 0x0000ff);
r*=0.2125f;
g*=0.7154f;
b*=0.0721f;
int gray=Math.min(((int)(r + g + b)),0xff) & 0xff;
return a | (gray << 16) | (gray << 8)| gray;
}
| Get a desaturated shade of an input color. |
private synchronized void notifyZoomListeners(ZoomEvent e){
for ( ZoomListener listener : mZoomListeners) {
listener.zoomApplied(e);
}
}
| Notify the zoom listeners about a zoom change. |
public CIMInstance checkExists(StorageSystem storage,Volume volume,boolean propagated,boolean includeClassOrigin) throws Exception {
CIMInstance instance=null;
CIMObjectPath objectPath=_cimPath.getBlockObjectPath(storage,volume);
try {
if (objectPath != null) {
_log.debug(String.format("checkExists(stor... | This method is a wrapper for the getInstance. If the object is not found, it returns a null value instead of throwing an exception. |
public IntArraySpliterator(int[] array,int origin,int fence,int additionalCharacteristics){
this.array=array;
this.index=origin;
this.fence=fence;
this.characteristics=additionalCharacteristics | Spliterator.SIZED | Spliterator.SUBSIZED;
}
| Creates a spliterator covering the given array and range |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.