code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public MutableInt(final int value){
super();
this.value=value;
}
| Constructs a new MutableInt with the specified value. |
@Override public DiscussionObject copy(){
return new DiscussionObject(this);
}
| This method was generated by MyBatis Generator. This method corresponds to the database table discussion |
public Composer bottomHitCallback(@NonNull AnimCallBack animCallBack){
mBottomHitCallback=animCallBack;
return this;
}
| Set callback when responding to a bottom base |
private void initializeCssOnErrorSet(){
if (cssOnErrorSet == null) {
cssOnErrorSet=new ArrayList<>();
}
cssOnErrorSet.clear();
}
| This method initializes or re-initializes the set of stylesheets on error related with a css |
private StringBuilder generateReportOutputStream(final ReportMailingJob reportMailingJob,final ReportMailingJobEmailAttachmentFileFormat emailAttachmentFileFormat,final MultivaluedMap<String,String> reportParams,final String reportName,final StringBuilder errorLog){
try {
final String reportType=this.readReportin... | generate the report output stream |
public int destroyParticlesInShape(Shape shape,Transform xf,boolean callDestructionListener){
assert (isLocked() == false);
if (isLocked()) {
return 0;
}
return m_particleSystem.destroyParticlesInShape(shape,xf,callDestructionListener);
}
| Destroy particles inside a shape. This function is locked during callbacks. In addition, this function immediately destroys particles in the shape in contrast to DestroyParticle() which defers the destruction until the next simulation step. |
@Override public boolean removeFromWorld(){
System.getProperties().remove("stendhal.minetown");
for ( LoadableContent loadableContent : content) {
loadableContent.removeFromWorld();
}
return true;
}
| removes a quest from the world. |
public void reportFailedAttempt(){
if (DEBUG) Log.d(TAG,"reportFailedAttempt()");
mHandler.sendEmptyMessage(MSG_REPORT_FAILED_ATTEMPT);
}
| Called when Face Unlock wants to increment the number of failed attempts. |
public boolean equals(Object objectToCompare){
if (super.equals(objectToCompare)) return true;
if (objectToCompare instanceof Candle) {
Candle candle=(Candle)objectToCompare;
if (this.getTradingday().equals(candle.getTradingday())) {
if (this.getContract().equals(candle.getContract())) {
if ... | Method equals. |
private static String findJarServiceProviderName(String factoryId){
SecuritySupport ss=SecuritySupport.getInstance();
String serviceId=SERVICES_PATH + factoryId;
InputStream is=null;
ClassLoader cl=findClassLoader();
is=ss.getResourceAsStream(cl,serviceId);
if (is == null) {
ClassLoader current=ObjectFa... | Find the name of service provider using Jar Service Provider Mechanism |
@Override protected DistributionSetMetadata createMetadata(final DistributionSet entity,final String key,final String value){
final DistributionSetMetadata dsMetaData=distributionSetManagement.createDistributionSetMetadata(entityFactory.generateDistributionSetMetadata(entity,key,value));
setSelectedEntity(dsMetaDat... | Create metadata for DistributionSet. |
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"STM");
translateAll(environment,instruction,"STM... | STM{<cond>}<addressing_mode> <Rn>, <registers>^ Operation: MemoryAccess(B-bit, E-bit) processor_id = ExecutingProcessor() if ConditionPassed(cond) then address = start_address for i = 0 to 15 if register_list[i] == 1 Memory[address,4] = Ri_usr address = address + 4 if Shared(address) then // from ARMv6 physical_address... |
private void restorePanelState(SparseArray<Parcelable> icicles){
PanelFeatureState st;
int curFeatureId;
for (int i=icicles.size() - 1; i >= 0; i--) {
curFeatureId=icicles.keyAt(i);
st=getPanelState(curFeatureId,false);
if (st == null) {
continue;
}
st.onRestoreInstanceState(icicles.get(... | Invoked when the panels should thaw their state from a previously frozen state. |
public ScaleAndIndex index(int index){
return new ScaleAndIndex(scale,index);
}
| Specifies a single quantile index to be calculated, i.e. the k in the kth q-quantile. |
public VostroItem(RegularTimePeriod period,BigDecimal vostro){
super(period,new Vostro(vostro));
}
| Creates a new instance of <code>CandleItem</code>. |
public void unsetMatchColumn(String[] columnIdxes) throws SQLException {
for (int j=0; j < columnIdxes.length; j++) {
if (!columnIdxes[j].equals(strMatchColumns.get(j))) {
throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.matchcols").toString());
}
}
for (int i=0; i < columnIdxes.leng... | Unsets the designated parameter to the given String array. This was set using <code>setMatchColumn</code> as the column which will form the basis of the join. <P> The parameter value unset by this method should be same as was set. |
public static String cot(String[] params) throws FBSQLParseException {
if (params.length != 1) throw new FBSQLParseException("Incorrect number of " + "parameters of function cot : " + params.length);
return "cot(" + params[0] + ")";
}
| Produce a function call for the <code>cot</code> UDF function. The syntax of the <code>cot</code> function is <code>{fn cot(float)}</code>. |
@Override public Object eInvoke(int operationID,EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case ImPackage.SYMBOL_TABLE_ENTRY_ORIGINAL___EXPORTED_NAME:
return exportedName();
}
return super.eInvoke(operationID,arguments);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@Deprecated public IOObject[] apply() throws OperatorException {
throw new UnsupportedOperationException("apply() is deprecated. Implement doWork().");
}
| Implement this method in subclasses. |
public Camera(Cameras camera){
makeCamera(camera.getID());
}
| Instantiate an instance of a camera <p/> WARNING! Each camera can only be instantiated in once place at a time - be sure to release() when you are done. |
public static boolean isKnownAsDefinition(BytecodeInstruction instruction){
return registeredDefs.containsKey(instruction);
}
| <p> isKnownAsDefinition </p> |
public void checkClientTrusted(X509Certificate[] cert,String authType) throws CertificateException {
}
| Doesn't throw an exception, so this is how it approves a certificate. |
private int readAnnotationValue(int v,final char[] buf,final String name,final AnnotationVisitor av){
int i;
if (av == null) {
switch (b[v] & 0xFF) {
case 'e':
return v + 5;
case '@':
return readAnnotationValues(v + 3,buf,true,null);
case '[':
return readAnnotationValues(v + 1,buf,false,null);
default :... | Reads a value of an annotation and makes the given visitor visit it. |
protected String[] explode(String arrayAsString){
arrayAsString=arrayAsString.trim();
if (arrayAsString.startsWith("(") && arrayAsString.endsWith(")")) {
arrayAsString=arrayAsString.substring(1,arrayAsString.length() - 1);
}
List v=StringUtil.tokenizeString(arrayAsString,',');
String a[]=new String[v.size... | Utility method for subclasses to convert an string to an array, delimited by comma, optionally enclosed in brackets, and elements optionally enclosed in quotes. |
private Map<String,Integer> collectAllIdentifiersFromDatabase(){
Map<String,Integer> mapFromDB=new HashMap<String,Integer>();
try {
mapFromDB=DAORegister.get().get(AchievementDAO.class).loadIdentifierIdPairs();
}
catch ( SQLException e) {
logger.error("Error while loading Identifier to id map for achiev... | collects all identifiers from the database |
@KnownFailure("If no schema is associated: returns empty string where actually null be returned?. Ticket 98") public void test_getTablesLjava_lang_StringLjava_lang_StringLjava_lang_String$Ljava_lang_String() throws SQLException {
String[] tablesName={VIEW_NAME,DatabaseCreator.TEST_TABLE1,DatabaseCreator.TEST_TABLE3};... | java.sql.DatabaseMetaData #getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) |
public String canonicalPath(String path) throws IOException {
int req_id=generateNextRequestID();
TypesWriter tw=new TypesWriter();
tw.writeString(path,charsetName);
if (debug != null) {
debug.println("Sending SSH_FXP_REALPATH...");
debug.flush();
}
sendMessage(Packet.SSH_FXP_REALPATH,req_id,tw.getB... | Have the server canonicalize any given path name to an absolute path. This is useful for converting path names containing ".." components or relative pathnames without a leading slash into absolute paths. |
public ContainerVmPeProvisionerSimple(double availableMips){
super(availableMips);
setPeTable(new HashMap<String,ArrayList<Double>>());
}
| Creates the PeProvisionerSimple object. |
private static void createAndShowGUI(JPanel jtop){
JFrame frame=new JFrame("JTop");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JComponent contentPane=(JComponent)frame.getContentPane();
contentPane.add(jtop,BorderLayout.CENTER);
contentPane.setOpaque(true);
contentPane.setBorder(new EmptyBorder(1... | Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread. |
@Override protected IMember resolveMember() throws JavaModelException {
char[] signature=fProposal.getSignature();
String typeName=SignatureUtil.stripSignatureToFQN(String.valueOf(signature));
return fJavaProject.findType(typeName);
}
| Resolves the member described by the receiver and returns it if found. Returns <code>null</code> if no corresponding member can be found. |
public RedirectRequiredException(int sc,String location){
super("Redirect Required");
setHttpErrorCodeOverride(sc);
getHttpHeaders().put(LOCATION,Collections.singletonList(location));
}
| Initialize the redirect required exception. |
public ConnectionResult connect(Transaction transaction,ConnectMode mode){
if (!transaction.getHash().equals(outpoint.getHash())) return ConnectionResult.NO_SUCH_TX;
checkElementIndex((int)outpoint.getIndex(),transaction.getOutputs().size(),"Corrupt transaction");
TransactionOutput out=transaction.getOutput((in... | Connects this input to the relevant output of the referenced transaction. Connecting means updating the internal pointers and spent flags. If the mode is to ABORT_ON_CONFLICT then the spent output won't be changed, but the outpoint.fromTx pointer will still be updated. |
public int readUI16() throws IOException {
synchBits();
int ui16=in.read();
if (ui16 < 0) {
throw new IOException("Unexpected end of input");
}
int val=in.read();
if (val < 0) {
throw new IOException("Unexpected end of input");
}
ui16+=val << 8;
bytesRead+=2;
return ui16;
}
| Read an unsigned 16 bit value |
public Capabilities build(){
return new Capabilities(this);
}
| Build the capabilities |
boolean isRightGrantedRecursive(Table table,int rightMask){
Right right;
if (grantedRights != null) {
if (table != null) {
right=grantedRights.get(table.getSchema());
if (right != null) {
if ((right.getRightMask() & rightMask) == rightMask) {
return true;
}
}
}
... | Check if a right is already granted to this object or to objects that were granted to this object. The rights for schemas takes precedence over rights of tables, in other words, the rights of schemas will be valid for every each table in the related schema. |
private void loadDBCharSize(){
s_logger.log(Level.FINE,"loadDBCharSize",getDirection());
String sql=null;
m_charDevisor=1;
int vc2Size=1;
int nvc2Size=1;
sql=s_dbEngine.sqlMetadata_openCharSetTest(getVendor(),getCatalog(),getSchema());
if (sql != null && sql.length() > 0) {
try {
Statement stmt=... | loads the size of a character in a database's national language (needed because buggy ORACLE jdbc driver sometimes uses size of BYTE instead of size of CHAR) |
protected Change createUndoChange(Change[] childUndos){
return new CompositeChange(getName(),childUndos);
}
| Hook to create an undo change. The method should be overridden by clients which provide their own composite change to create a corresponding undo change. |
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
if (verbose) {
log("Creating/getting cached template...");
}
Template template;
long getMillis;
String name;
File file=getScriptUriAsFile(request);
if (file != null) {
name=file.getN... | Services the request with a response. <p> First the request is parsed for the source file uri. If the specified file could not be found or can not be read an error message is sent as response. |
public ExtentTest info(Throwable t){
log(Status.INFO,t);
return this;
}
| Logs an event with <code>Status.INFO</code> and exception |
public static RefreshMemberSnapshotResponse create(DistributionManager dm,InternalDistributedMember recipient){
RefreshMemberSnapshotResponse m=new RefreshMemberSnapshotResponse();
m.setRecipient(recipient);
try {
DistributedSystem sys=dm.getSystem();
GemFireCacheImpl c=(GemFireCacheImpl)CacheFactory.getI... | Returns a <code>FetchSysCfgResponse</code> that will be returned to the specified recipient. The message will contains a copy of the local manager's config. |
public <T extends GphotoEntry>T insert(GphotoEntry<?> parent,T entry) throws IOException, ServiceException {
String feedUrl=getLinkByRel(parent.getLinks(),Link.Rel.FEED);
return service.insert(new URL(feedUrl),entry);
}
| Insert an entry into another entry. Because our entries are a hierarchy, this lets you insert a photo into an album even if you only have the album entry and not the album feed, making it quicker to traverse the hierarchy. |
@Override public String brpoplpush(String source,String destination,int timeout){
client.brpoplpush(source,destination,timeout);
client.setTimeoutInfinite();
try {
return client.getBulkReply();
}
finally {
client.rollbackTimeout();
}
}
| Pop a value from a list, push it to another list and return it; or block until one is available |
public boolean pointOutside(final double x,final double y,final double z){
return (x * x + y * y) * inverseAb * inverseAb + z * z * inverseC* inverseC - 1.0 > Vector.MINIMUM_RESOLUTION;
}
| Check if point is outside surface. |
public String[] jplot(double[] x,double[] y,double[]... args){
if (args.length % 2 != 0) {
throw new IllegalArgumentException("There should be even number of " + "input arrays! It is: " + args.length);
}
int noOfSeries=args.length / 2 + 1;
String[] seriesKeys=new String[noOfSeries];
seriesKeys[0]=jplot(x,... | This method plots lines. Colors are cycled in the following order: "y", "c", "m", "k", "r", "g", "b". |
public void createStory(RoutingContext context){
context.response().setChunked(true);
context.response().write("<!DOCTYPE html>" + "<html lang=\"en\">" + "<head>"+ " <title>Index</title>"+ " <link rel=\"stylesheet\" href=\"/components/bootstrap/dist/css/bootstrap.min.css\">"+ " <link rel=\"stylesheet\" hre... | This is an example of a method that's called by the web routing |
public void removeListener(Listener<TunerConfigurationEvent> listener){
mConfigurationChangeListeners.remove(listener);
}
| Removes the tuner configuration event listener |
@HLEFunction(nid=0x8ABADD51,version=150) public int sceNetApctlAddHandler(TPointer handler,int handlerArg){
int uid=SceUidManager.getNewUid(uidPurpose);
ApctlHandler apctlHandler=new ApctlHandler(uid,handler.getAddress(),handlerArg);
apctlHandlers.put(uid,apctlHandler);
return uid;
}
| Add an apctl event handler. |
public BasicElevationModelBulkDownloader(BasicElevationModel elevationModel,Sector sector,double resolution,FileStore fileStore,BulkRetrievalListener listener){
super(elevationModel,sector,resolution,fileStore,listener);
this.elevationModel=elevationModel;
this.level=computeLevelForResolution(sector,resolution);
... | Constructs a downloader to retrieve elevations not currently available in a specified file store. <p/> The thread returned is not started during construction, the caller must start the thread. |
@DSSink({DSSinkKind.SYNCHRONIZATION_DATA}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:44.182 -0500",hash_original_method="029397BC692B989F9FCA48D48FDB9479",hash_generated_method="D01052788D1D7136B5EB7BB540B7EA01") public void sendStringSync(String text){
if (text == null) ... | Sends the key events corresponding to the text to the app being instrumented. |
@Override public String toString(){
try {
if (type == INDIRECT) {
StringBuffer str=new StringBuffer();
str.append("Indirect to #" + ((PDFXref)value).getID() + (((PDFXref)value).getCompressed() ? " comp" : ""));
try {
PDFObject obj=cachedDereference();
str.append("\n" + (obj == nu... | return a representation of this PDFObject as a String. Does NOT dereference anything: this is the only method that allows you to distinguish an INDIRECT PDFObject. |
private void initDHKeys(DistributionConfig config) throws Exception {
dhSKAlgo=config.getSecurityUDPDHAlgo();
if ((dhSKAlgo != null && dhSKAlgo.length() > 0)) {
KeyPairGenerator keyGen=KeyPairGenerator.getInstance("DH");
DHParameterSpec dhSpec=new DHParameterSpec(dhP,dhG,dhL);
keyGen.initialize(dhSpec);... | Initialize the Diffie-Hellman keys. This method is not thread safe |
public void transition(CopycatServer.State state){
checkThread();
if (this.state != null && state == this.state.type()) {
return;
}
LOGGER.info("{} - Transitioning to {}",cluster.member().address(),state);
try {
this.state.close().get();
}
catch ( InterruptedException|ExecutionException e) {
t... | Transition handler. |
public void alter(Instance instance,Transform matrix,AlphaTransform cxform,int ratio){
Placement placement=new Placement(instance,matrix,cxform,null,ratio,-1,frameNumber,true,false,null);
placements.add(placement);
}
| Alter the symbol instance by applying the given properties. Only one alteration may be made to an Instance in any given frame. |
public static <K,V>SynchronizedBagMultimap<K,V> of(MutableBagMultimap<K,V> multimap){
if (multimap == null) {
throw new IllegalArgumentException("cannot create a SynchronizedBagMultimap for null");
}
return new SynchronizedBagMultimap<>(multimap);
}
| This method will take a Multimap and wrap it directly in a SynchronizedBagMultimap. |
public final void popPair(){
m_firstFree-=2;
m_map[m_firstFree]=DTM.NULL;
m_map[m_firstFree + 1]=DTM.NULL;
}
| Pop a pair of nodes from the tail of the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical. |
public MultiplePathsFromGCRootsRecord[] nextLevel(){
int new_level=level + 1;
HashMapIntObject<MultiplePathsFromGCRootsRecord> nextLevelRecords=new HashMapIntObject<MultiplePathsFromGCRootsRecord>();
for ( int[] path : paths) {
if (path != null && (path.length - new_level - 1 >= 0)) {
MultiplePathsFrom... | Returns the next level of the paths. For all paths going through this object the next objects in the paths are taken and grouped again (i.e. the lenght of the returned array will be equal to the number of different objects at the next depth level of the paths). The direction is from the GC roots to the objects |
public boolean adjacent(int direction){
return (direction == QuadTreeNode.NORTH || direction == QuadTreeNode.EAST);
}
| Return true iff this quadrant is adjacent to the boundary of an image in the given direction. |
public DerValue(byte[] buf,int offset,int len) throws IOException {
data=init(true,new ByteArrayInputStream(buf,offset,len));
}
| Get an ASN.1/DER encoded datum from part of a buffer. That part of the buffer must hold exactly one datum, including its tag and length. |
public void stop() throws CastException, TransientNetworkDisconnectionException, NoConnectionException {
stop(null);
}
| Stops the playback of media/stream |
public void update(int val){
byte[] b=new byte[4];
b[0]=(byte)((val >>> 24) & 0xff);
b[1]=(byte)((val >>> 16) & 0xff);
b[2]=(byte)((val >>> 8) & 0xff);
b[3]=(byte)(val & 0xff);
update(b);
}
| Updates the CRC32 value from each byte of the given int value. The bytes are used in the big endian order. |
public boolean intersectsPolygon(Polygon2D poly){
List<Line2D> edgesB=poly.getEdges();
for ( Line2D ea : getEdges()) {
if (intersectsLine(ea,edgesB)) {
return true;
}
}
return false;
}
| Checks if the given polygon intersect this one by checking all edges for line intersections. |
public static BigDecimal open(int p_C_Invoice_ID,int p_C_InvoicePaySchedule_ID) throws SQLException {
int C_Currency_ID=0;
int C_ConversionType_ID=0;
BigDecimal GrandTotal=null;
BigDecimal MultiplierAP=null;
BigDecimal MultiplierCM=null;
String sql="SELECT MAX(C_Currency_ID),MAX(C_ConversionType_ID)," + " S... | Open Invoice Amount. - incoiceOpen |
private final void sendMessageToConnection(OFMessage m){
connection.messageReceived(m);
}
| Notifies the channel listener that we have a valid baseline connection |
public static GF2Matrix createCanonicalCheckMatrix(GF2mField field,PolynomialGF2mSmallM gp){
int m=field.getDegree();
int n=1 << m;
int t=gp.getDegree();
int[][] hArray=new int[t][n];
int[][] yz=new int[t][n];
for (int j=0; j < n; j++) {
yz[0][j]=field.inverse(gp.evaluateAt(j));
}
for (int i=1; i < ... | Construct the check matrix of a Goppa code in canonical form from the irreducible Goppa polynomial over the finite field <tt>GF(2<sup>m</sup>)</tt>. |
public final int compareTo(E o){
Enum<?> other=(Enum<?>)o;
Enum<E> self=this;
if (self.getClass() != other.getClass() && self.getDeclaringClass() != other.getDeclaringClass()) throw new ClassCastException();
return self.ordinal - other.ordinal;
}
| Compares this enum with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Enum constants are only comparable to other enum constants of the same enum type. The natural order implemented by this method is... |
public void testSignumZero(){
String a="0";
int aScale=41;
BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale);
assertEquals("incorrect value",0,aNumber.signum());
}
| signum() for zero |
public void keyRelease(int keyCode){
TestUtils.keyRelease(keyCode);
}
| This method just invokes the test utils method, it is here for convenience |
private SubstInNode processSubst(TreeNode treeNode,TreeNode[] substNodes,SymbolTable instancerST,Context instanceeCtxt,ModuleNode instanceeModule,ModuleNode mn) throws AbortException {
TreeNode[] children;
Vector decls=instanceeCtxt.getByClass(OpDeclNode.class);
SubstInNode substIn=new SubstInNode(treeNode,instan... | Process the substitutions clause of a module definition or instantiation; returns a SubstInNode that can be used as a template for the wrapper that must be present around each OpDefNode body created from the module instantiation or module definition. |
public Matrix4f translationRotateScaleInvert(float tx,float ty,float tz,float qx,float qy,float qz,float qw,float sx,float sy,float sz){
float nqx=-qx, nqy=-qy, nqz=-qz;
float dqx=nqx + nqx;
float dqy=nqy + nqy;
float dqz=nqz + nqz;
float q00=dqx * nqx;
float q11=dqy * nqy;
float q22=dqz * nqz;
float q0... | Set <code>this</code> matrix to <tt>(T * R * S)<sup>-1</sup></tt>, where <tt>T</tt> is a translation by the given <tt>(tx, ty, tz)</tt>, <tt>R</tt> is a rotation transformation specified by the quaternion <tt>(qx, qy, qz, qw)</tt>, and <tt>S</tt> is a scaling transformation which scales the three axes x, y and z by <tt... |
public boolean containsKey(long key){
return contains(key);
}
| checks for the present of <tt>key</tt> in the keys of the map. |
public static _Fields findByThriftIdOrThrow(int fieldId){
_Fields fields=findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
| Find the _Fields constant that matches fieldId, throwing an exception if it is not found. |
public void considerPathXRegions(GeoPath path,Collection regions){
for (GeoPath.SegmentIterator pit=path.segmentIterator(); pit.hasNext(); ) {
GeoSegment seg=pit.nextSegment();
Iterator rit;
if (regions instanceof ExtentIndex) {
rit=((ExtentIndex)regions).iterator(seg);
}
else {
rit=regio... | Puts regions in the Collector if they intersect the path. |
public static boolean checkDuplicatesWithinK(int[] arr,int k){
if (arr == null || arr.length == 0 || arr.length < k) return false;
Set<Integer> set=new HashSet<Integer>();
for (int i=0; i < arr.length; i++) {
if (set.contains(arr[i])) return true;
set.add(arr[i]);
if (i >= k) set.remove(arr[... | O(n) Time, O(n) Space Use Set to store elements within k Go through the array If not in map, put it and its index in map If in map, return true Otherwise, add arr[i] to map and remove arr[i - k] |
public EsriPolylineZList(){
super();
}
| Construct an EsriPolylineList. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:12.712 -0500",hash_original_method="DA5270F6FAC446A7F1E0A4F7A45712B2",hash_generated_method="CC45C819AC99492B223D0D8A3E72BB57") public boolean isFlipping(){
return mStarted;
}
| Returns true if the child views are flipping. |
public static byte[] append(byte buffer[],byte newElement){
byte[] t=resize(buffer,buffer.length + 1);
t[buffer.length]=newElement;
return t;
}
| Appends an element to <code>byte</code> array. |
public boolean optBoolean(String key){
return optBoolean(key,false);
}
| Get an optional boolean associated with a key. It returns false if there is unknown such key, or if the value is not Boolean.TRUE or the String "true". |
@Override public void lights(){
enableLighting();
lightCount=0;
int colorModeSaved=colorMode;
colorMode=RGB;
lightFalloff(1,0,0);
lightSpecular(0,0,0);
ambientLight(colorModeX * 0.5f,colorModeY * 0.5f,colorModeZ * 0.5f);
directionalLight(colorModeX * 0.5f,colorModeY * 0.5f,colorModeZ * 0.5f,0,0,-1);
c... | Sets up an ambient and directional light using OpenGL. API taken from PGraphics3D. <PRE> The Lighting Skinny: The way lighting works is complicated enough that it's worth producing a document to describe it. Lighting calculations proceed pretty much exactly as described in the OpenGL red book. Light-affecting material ... |
public static boolean doubleEqual(double a,double b,double precision){
return java.lang.Math.abs(a - b) <= precision;
}
| Return whether two double-precision floating point numbers are equal. They are considered equal when their difference is less than or equal to the precision. |
public void write(byte[] src,int offset,int length) throws EOFException {
long limit=allocate();
long commitPos=limit;
limit+=Length.StatusFlags;
mem.putInt(limit,length);
limit+=Length.Metadata;
mem.setBytes(limit,src,offset,length);
commit(commitPos);
}
| Writes a buffer of data. |
public void testPutDate(){
byte[] expectedResult={16,0,0,1,(byte)0xD8,(byte)0x07,3,10,(byte)0xE8,(byte)0x03,1,1,(byte)0x0F,(byte)0x27,12,31,(byte)0xAC,(byte)0x01,5,21};
GregorianCalendar cNowOurDays=new GregorianCalendar(2008,2,10);
GregorianCalendar cLowRange=new GregorianCalendar(1000,0,1);
GregorianCalendar ... | Tests the testPutDate() method with a simple date (2008-03-10) |
public Analyzer includeInvertedGenerationalDistance(){
includeInvertedGenerationalDistance=true;
return this;
}
| Enables the evaluation of the inverted generational distance metric. |
public void close(){
exiting=true;
if (currentThread != null) {
currentThread.interrupt();
}
if (channel.isConnected()) {
try {
channel.close();
}
catch ( Exception ex) {
}
}
}
| Close socket |
public boolean isBeforeNow(){
return isBefore(DateTimeUtils.currentTimeMillis());
}
| Is this instant before the current instant comparing solely by millisecond. |
public boolean containsAll(Collection c){
Iterator i=c.iterator();
while (i.hasNext()) {
if (!contains(i.next())) {
return false;
}
}
return true;
}
| Returns true if this composite graphics node contains all the graphics node in the specified collection, false otherwise. |
private void addHyperlinkToken(int start,int end,int tokenType){
int so=start + offsetShift;
addToken(zzBuffer,start,end,tokenType,so,true);
}
| Adds the token specified to the current linked list of tokens. |
public void removeCategory(String category){
if (mCategories != null) {
mCategories.remove(category);
if (mCategories.size() == 0) {
mCategories=null;
}
}
}
| Remove a category from an intent. |
@Override protected EClass eStaticClass(){
return OrientedPackage.Literals.PORT;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
void onCancelPermissionRequest(){
rationaleAccepted.set(false);
updatePermissionsAsDenied(pendingPermissions);
}
| Method called when the user has been informed with a rationale and decides to cancel the permission request process |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case UmplePackage.EXTERNAL_DEFINITION___INTERFACE_1:
return interface_1 != INTERFACE_1_EDEFAULT;
case UmplePackage.EXTERNAL_DEFINITION___NAME_1:
return NAME_1_EDEFAULT == null ? name_1 != null : !NAME_1_EDEFAULT.equals(name_1);
case UmplePackage... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public _BuildControllerUpdate(final String[] flagStrings){
super(flagStrings);
}
| Constructs a _BuildControllerUpdate with the given flags initially set. |
public void doRender(Entity p_76986_1_,double p_76986_2_,double p_76986_4_,double p_76986_6_,float p_76986_8_,float p_76986_9_){
this.doRender((EntityBullet)p_76986_1_,p_76986_2_,p_76986_4_,p_76986_6_,p_76986_8_,p_76986_9_);
}
| Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, doub... |
protected void updateOKButtonAction(){
okButton.setEnabled(!textField.getText().equals(""));
}
| To update the state of the OK button |
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
ObjectInputStream.GetField f=s.readFields();
try {
dropTargetContext=(DropTargetContext)f.get("dropTargetContext",null);
}
catch ( IllegalArgumentException e) {
}
if (dropTargetContext == null) {
dropTargetCont... | Deserializes this <code>DropTarget</code>. This method first performs default deserialization for all non-<code>transient</code> fields. An attempt is then made to deserialize this object's <code>DropTargetListener</code> as well. This is first attempted by deserializing the field <code>dtListener</code>, because, in r... |
public void testField(){
checkPublicKey cPK=new checkPublicKey();
assertEquals("Incorrect serialVersionUID",cPK.getSerVerUID(),7187392471159151072L);
}
| Test for <code>serialVersionUID</code> field |
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
request.getSession().setAttribute("school","yykj");
response.sendRedirect("servlet/SchoolServlet");
return;
}
| The doGet method of the servlet. <br> This method is called when a form has its tag value method equals to get. |
public SubscriptionMigrationException(String message,SubscriptionMigrationExceptionBean bean){
super(message,bean);
this.bean=bean;
}
| Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization. |
public <T>T giveRed(TypeTag tag){
return this.<T>giveTuple(tag).getRed();
}
| Returns the "red" prefabricated value of the specified type. It's always a different value from the "black" one. |
public SignatureManifest(String rnd,List<MessagePart> hashes){
this.rnd=rnd;
for ( MessagePart hash : hashes) {
addReference(hash);
}
}
| Creates a new manifest from a given random and list of references. |
public DebuggerTemplate(final com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate template){
m_template=template;
m_template.addListener(m_internalListener);
}
| Creates a new debugger template. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.