code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public void onScrollDown(View view){
if (!checkReady()) {
return;
}
changeCamera(CameraUpdateFactory.scrollBy(0,SCROLL_BY_PX));
}
| Called when the down arrow button is clicked. This causes the camera to move down. |
public void clearSpanningTree(){
m_spanning=null;
}
| Clear the internally stored spanning tree. Any new calls to a getSpanningTree() method will generate a new spanning tree instance as needed. This method is primarily useful for subclasses. For example, calling this method on a Tree instance will revert the state to the original rooted tree such that a sbusequent call ... |
protected boolean afterSave(boolean newRecord,boolean success){
if (!success) return success;
if (newRecord) insert_Tree(MTree_Base.TREETYPE_Activity);
if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) MAccount.updateValueDescription(getCtx(),"C_Activity_ID=" + getC_Activity_ID(),get_... | After Save. Insert - create tree |
public void addHelpMenu(String ref,boolean direct){
JMenuBar bar=getJMenuBar();
if (bar == null) {
bar=new JMenuBar();
}
bar.add(new WindowMenu(this));
jmri.util.HelpUtil.helpMenu(bar,ref,direct);
setJMenuBar(bar);
}
| Add a standard help menu, including window specific help item. |
public static boolean looksLikeBluetoothAddress(String s){
return Pattern.matches("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$",s);
}
| Sanity check a string for whether it looks basically like a BT MAC. Just regexes the string, looking for 6 groups of hex digits deparated by : or -. Case insensitive. |
public static void copyProperties(Object dest,Object src){
if (dest == null || src == null) {
return;
}
try {
PropertyUtils.copyProperties(dest,src);
}
catch ( IllegalAccessException e) {
throw new IllegalStateException(e);
}
catch ( InvocationTargetException e) {
throw new IllegalStateExce... | it is null safe |
public boolean isEncrypted(int index){
if (index < 0 || index >= m_columns.length) return false;
return m_columns[index].IsEncrypted;
}
| Is Column (data) Encrypted |
public void testTooManySegments() throws Exception {
Directory dir=getAssertNoDeletesDirectory(new RAMDirectory());
IndexWriterConfig iwc=new IndexWriterConfig(new MockAnalyzer(random()));
IndexWriter w=new IndexWriter(dir,iwc);
for (int i=0; i < 500; i++) {
Document doc=new Document();
doc.add(newStrin... | Make sure if all we do is open NRT reader against writer, we don't see merge starvation. |
public void testFlipBitZero(){
byte aBytes[]={0};
int aSign=0;
int number=0;
byte rBytes[]={1};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger result=aNumber.flipBit(number);
byte resBytes[]=new byte[rBytes.length];
resBytes=result.toByteArray();
for (int i=0; i < resBytes.length; i++) {
... | flipBit(int n) zero |
private void initData(){
this.totalDistance=(int)DisplayUtils.dpToPx(getActivity(),156);
this.weatherUtils=new WeatherUtils();
this.locationUtils=new LocationUtils(getActivity());
}
| <br> data. |
public void includeSchema(String schemaLocation) throws SAXException {
NGCCRuntimeEx runtime=new NGCCRuntimeEx(parser,chameleonMode,this);
runtime.currentSchema=this.currentSchema;
runtime.blockDefault=this.blockDefault;
runtime.finalDefault=this.finalDefault;
if (schemaLocation == null) {
SAXParseExcepti... | Includes the specified schema. |
public MapViewFrame(String[] args){
this();
for ( String arg : args) {
try {
if (arg.startsWith("-screenwidth=")) {
view.setScreenWidthInCentimeter(Double.parseDouble(arg.substring(13)));
break;
}
else if (arg.startsWith("-screensize=")) {
view.setScreenSizeInInch(Dou... | Tries to find an argument starting with <code>-screenwidth=</code> or <code>-screensize=</code> and passes the corresponding number to the view for scale computation. |
public BowlerStudio3dEngine(){
setSubScene(new SubScene(getRoot(),1024,1024,true,null));
buildScene();
buildCamera();
buildAxes();
Stop[] stops=null;
getSubScene().setFill(new LinearGradient(125,0,225,0,false,CycleMethod.NO_CYCLE,stops));
Scene s=new Scene(new Group(getSubScene()));
handleMouse(getSubSc... | Instantiates a new jfx3d manager. |
protected boolean hasBinary(){
Set<String> keys=mParamKeyValues.keySet();
for ( String key : keys) {
List<Object> values=mParamKeyValues.getValues(key);
for ( Object value : values) {
if (value instanceof Binary) return true;
}
}
return false;
}
| Has Binary. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
return MMC.getInstance().getCaptureDeviceNames();
}
| Returns all of the CaptureDevices in the system that SageTV can use |
public synchronized void mark(final int limit){
try {
in.mark(limit);
}
catch ( IOException ioe) {
throw new RuntimeException(ioe.getMessage());
}
}
| Marks the read limit of the Reader. |
public boolean showTipsOnStartup(){
return jcbShowTipsOnStartup.isSelected();
}
| Show tips on startup? |
public static HttpResponse doPut(String host,String path,String method,Map<String,String> headers,Map<String,String> querys,byte[] body) throws Exception {
HttpClient httpClient=wrapClient(host);
HttpPut request=new HttpPut(buildUrl(host,path,querys));
for ( Map.Entry<String,String> e : headers.entrySet()) {
... | Put stream |
private String _serializeMap(String name,Map map,StringBuilder sb,Set<Object> done) throws ConverterException {
if (useShortcuts) sb.append("{}");
else sb.append("new Object();");
Iterator it=map.keySet().iterator();
while (it.hasNext()) {
Object key=it.next();
String skey=StringUtil.toLowerCase(Stri... | serialize a Map (as Struct) |
public boolean isFijo(){
return fijo;
}
| Gets the fijo value for this CalendarioDia. |
public void complainOnDeferredNullChecks(BlockScope scope,FlowInfo callerFlowInfo){
for (int i=0; i < this.innerFlowContextsCount; i++) {
this.upstreamNullFlowInfo.addPotentialNullInfoFrom(this.innerFlowContexts[i].upstreamNullFlowInfo).addPotentialNullInfoFrom(this.innerFlowInfos[i]);
}
this.innerFlowContext... | Perform deferred checks relative to the null status of local variables. |
@Override public void onActivityDestroyed(Activity activity){
synchronized (NfcActivityManager.this) {
NfcActivityState state=findActivityState(activity);
if (DBG) Log.d(TAG,"onDestroy() for " + activity + " "+ state);
if (state != null) {
destroyActivityState(activity);
}
}
}
| Callback from Activity life-cycle, on main thread |
@TargetApi(21) public static ArtistDetailsFragment newInstance(ArtistListFragment.ViewHolder vh){
ArtistDetailsFragment fragment=new ArtistDetailsFragment();
Bundle args=new Bundle();
args.putInt(ArtistOverviewFragment.BUNDLE_KEY_ARTISTID,vh.artistId);
args.putInt(AlbumListFragment.BUNDLE_KEY_ARTISTID,vh.artist... | Create a new instance of this, initialized to show tvshowId |
public boolean canSet(Class type){
if (type == null) return false;
if (m_columnType.isPrimitive()) {
return m_columnType.isAssignableFrom(type) || TypeLib.getWrapperType(m_columnType).isAssignableFrom(type) || String.class.isAssignableFrom(type);
}
else {
return m_columnType.isAssignableFrom(type);
}... | Indicates if the set method can be called without an exception being thrown for the given type. |
AlignmentPatternFinder(BitMatrix image,int startX,int startY,int width,int height,float moduleSize,ResultPointCallback resultPointCallback){
this.image=image;
this.possibleCenters=new ArrayList<>(5);
this.startX=startX;
this.startY=startY;
this.width=width;
this.height=height;
this.moduleSize=moduleSize;
... | <p>Creates a finder that will look in a portion of the whole image.</p> |
public static boolean hasContent(Node node){
if (node.getNodeName().equals("#comment")) {
return false;
}
else if (node.getNodeName().equals("#text")) {
return !node.getNodeValue().trim().isEmpty();
}
return true;
}
| Returns true if the node has some actual content (other than a comment or an empty text). |
@Override public CategoryItemRendererState initialise(Graphics2D g2,Rectangle2D dataArea,CategoryPlot plot,int rendererIndex,PlotRenderingInfo info){
CategoryItemRendererState state=super.initialise(g2,dataArea,plot,rendererIndex,info);
CategoryAxis domainAxis=getDomainAxis(plot,rendererIndex);
CategoryDataset da... | Initialises the renderer. This method gets called once at the start of the process of drawing a chart. |
IsilonSyncPolicy doEnableReplicationPolicy(IsilonApi isi,String policyName){
IsilonSyncPolicy modifiedPolicy=new IsilonSyncPolicy();
modifiedPolicy.setName(policyName);
modifiedPolicy.setEnabled(true);
isi.modifyReplicationPolicy(policyName,modifiedPolicy);
return isi.getReplicationPolicy(policyName);
}
| Enable the Isilon syncIQ policy |
@Ignore("Not supported") public void testRmRootDirRecursiveIsForbidden() throws Throwable {
Path root=path(getBaseURI() + "/");
Path testFile=path(getBaseURI() + "/test");
createFile(testFile);
assertTrue("rm(/) returned false",sFileSystem.delete(root,true));
assertExists("Root dir is missing",root);
assert... | Test recursive root directory deletion fails if there is an entry underneath |
public DoubleVector(double[] values){
this.values=values.clone();
}
| Create a DoubleVector consisting of the given double values. |
public final void testRSAOtherPrimeInfo01(){
Object o=new RSAOtherPrimeInfo(BigInteger.valueOf(1L),BigInteger.valueOf(2L),BigInteger.valueOf(3L));
assertTrue(o instanceof RSAOtherPrimeInfo);
}
| Test #1 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor Assertion: constructs <code>RSAOtherPrimeInfo</code> object using valid parameter |
long toCompactValue(int sign){
if (intLen == 0 || sign == 0) return 0L;
int[] mag=getMagnitudeArray();
int len=mag.length;
int d=mag[0];
if (len > 2 || (d < 0 && len == 2)) return INFLATED;
long v=(len == 2) ? ((mag[1] & LONG_MASK) | (d & LONG_MASK) << 32) : d & LONG_MASK;
return sign == -1 ? -v : v;
... | This is for internal use in converting from a MutableBigInteger object into a long value given a specified sign. returns INFLATED if value is not fit into long |
private InetAddress resolveRestTcpHost(IgniteConfiguration cfg) throws IOException {
String host=cfg.getConnectorConfiguration().getHost();
if (host == null) host=cfg.getLocalHost();
return U.resolveLocalHost(host);
}
| Resolves host for REST TCP server using grid configuration. |
public static <T>T checkNotNull(T reference){
if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) {
throw new NullPointerException();
}
return reference;
}
| Ensures that an object reference is not null. |
public void deleteArtifact(Artifact artifact,Version version) throws IOException {
if (downloadProgress != null) {
Map<Artifact,Version> artifacts2Download=downloadProgress.getArtifacts2Download();
if (artifacts2Download.containsKey(artifact) && artifacts2Download.get(artifact).equals(version)) {
throw ... | Delete binaries of already downloaded artifact |
@Override public synchronized void updateDate(String columnName,java.sql.Date x) throws SQLException {
updateDate(findColumn(columnName),x);
}
| JDBC 2.0 Update a column with a Date value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database. |
public void addAnnotation(double x,double y,String annotation,float angle){
m_xyAnnotation=new XYPointerAnnotation(annotation,x,y,-angle * Math.PI / 180);
m_xyAnnotation.setLabelOffset(m_xyAnnotation.getLabelOffset() * 2 + 10);
if (m_chart != null) {
XYPlot plot=m_chart.getXYPlot();
plot.addAnnotation(m_x... | Draws annotation on the chart. |
public void init(boolean encrypting,CipherParameters params) throws IllegalArgumentException {
if (params instanceof ParametersWithIV) {
ParametersWithIV ivParam=(ParametersWithIV)params;
byte[] iv=ivParam.getIV();
if (iv.length < IV.length) {
System.arraycopy(iv,0,IV,IV.length - iv.length,iv.length... | Initialise the cipher and, possibly, the initialisation vector (IV). If an IV isn't passed as part of the parameter, the IV will be all zeros. An IV which is too short is handled in FIPS compliant fashion. |
public static boolean isFromUserModule(SemanticNode node){
SyntaxTreeNode csNode=(SyntaxTreeNode)node.stn;
String name=ResourceHelper.getModuleFileName(csNode.getFilename());
return ToolboxHandle.isUserModule(name);
}
| Returns true if the node is not from a standard module. |
@Override protected void initListeners(){
}
| Initialize the View of the listener |
private static List<DateValue> dateRange(DateValue start,DateValue end){
DTBuilder b=new DTBuilder(start);
List<DateValue> list=new ArrayList<DateValue>();
while (true) {
DateValue d=b.toDate();
if (d.compareTo(end) > 0) {
break;
}
list.add(d);
b.day+=1;
}
return list;
}
| Generates a list of dates in between two given dates. Each date is one day apart. |
public TimingHit userTimingTime(Integer value){
setInteger(USER_TIMING_TIME,value);
return this;
}
| <div class="ind"> <p> Optional. </p> <p>Specifies the user timing value. The value is in milliseconds.</p> <table border="1"> <tbody> <tr> <th>Parameter</th> <th>Value Type</th> <th>Default Value</th> <th>Max Length</th> <th>Supported Hit Types</th> </tr> <tr> <td><code>utt</code></td> <td>integer</td> <td><span class=... |
public int readInteger(String key){
Integer value=(Integer)mCache.get(key);
if (value == null) {
value=Integer.parseInt(readParameter(key));
mCache.put(key,value);
}
return value;
}
| Read int parameter <p/> If parsing of the value fails, method return default value. |
public static Inet4Address fromInteger(int address){
return getInet4Address(Ints.toByteArray(address));
}
| Returns an Inet4Address having the integer value specified by the argument. |
private static GoogleJsonErrorContainer errorWithReasonAndStatus(String reason,int status){
ErrorInfo info=new ErrorInfo();
info.setReason(reason);
info.setDomain("global");
GoogleJsonError error=new GoogleJsonError();
error.setErrors(ImmutableList.of(info));
error.setCode(status);
GoogleJsonErrorContaine... | A helper that generates the error JSON payload that Google APIs produce. |
public String toString(){
return iBuffer.toString();
}
| returns content -- characters \n are replaced by tag <br> |
public void onPackageDisappeared(String packageName,int reason){
}
| Called when a package disappears for any reason. |
public Edge lookupEdgeById(int id){
Iterator<Edge> i=edgeIterator();
while (i.hasNext()) {
Edge edge=i.next();
if (edge.getId() == id) {
return edge;
}
}
return null;
}
| Look up an Edge by its id. |
void sub(int b){
for (int i=0; i < coeffs.length; i++) {
coeffs[i]-=b;
}
}
| Subtracts a <code>int</code> from each coefficient. Does not return a new polynomial but modifies this polynomial. |
public java.lang.StringBuffer insert(int offset,java.lang.Object obj){
internal.insert(offset,obj);
return this;
}
| Inserts the string representation of the Object argument into this string buffer. The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset. The offset argument must be greater than or equal to 0, ... |
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createFunction(CreateFunctionRequest request,@HeaderParam("amz-sdk-invocation-id") String awsSdkInvocationId){
log.info("creating function");
FunctionConfiguration fc=new FunctionConfiguration();
fc.setFunctionName(r... | Implementation of http://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html |
public static Timestamp plus(Timestamp self,int days){
Calendar calendar=(Calendar)Calendar.getInstance().clone();
calendar.setTime(self);
calendar.add(Calendar.DAY_OF_YEAR,days);
Timestamp ts=new Timestamp(calendar.getTime().getTime());
ts.setNanos(self.getNanos());
return ts;
}
| Add number of days to this Timestamp and returns the new Timestamp object. |
public synchronized static String formatGMT(long gmtTime){
_gmtDate.setGMTTime(gmtTime);
return _gmtDate.printDate();
}
| Formats a date, using the default time format. |
public CompareToBuilder append(final char lhs,final char rhs){
if (comparison != 0) {
return this;
}
comparison=((lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0));
return this;
}
| Appends to the <code>builder</code> the comparison of two <code>char</code>s. |
public static UnknownAttributesAttribute createUnknownAttributesAttribute(){
UnknownAttributesAttribute attribute=new UnknownAttributesAttribute();
return attribute;
}
| Creates an empty UnknownAttributesAttribute. |
public Line3D(Stack<Vector3> points,float thickness,int color){
this(points,thickness,null);
setColor(color);
}
| Creates a line primitive with a single color. |
public static void renderValue(StringWriter writer,Object parameterValue){
if (parameterValue instanceof EPStatementObjectModel) {
writer.write("(");
((EPStatementObjectModel)parameterValue).toEPL(writer);
writer.write(")");
}
else if (parameterValue instanceof Expression) {
((Expression)paramete... | Render prameter. |
@Inline protected final void logMessage(int minVerbose,String message){
if (Options.verbose.getValue() >= minVerbose) {
Log.prependThreadId();
Log.write(" ");
Log.writeln(message);
}
}
| This method logs a message with prepended thread id, if the verbosity level is greater or equal to the passed level. |
public static boolean putMapNotEmptyKey(Map<String,String> map,String key,String value){
if (map == null || StringUtils.isEmpty(key)) {
return false;
}
map.put(key,value);
return true;
}
| add key-value pair to map, and key need not null or empty |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:11.654 -0500",hash_original_method="C36F2E0651BF3F93251D9AAA1075E241",hash_generated_method="691DCD4142B8BB56E48201EC4322E72A") public boolean add(E e){
return al.addIfAb... | Adds the specified element to this set if it is not already present. More formally, adds the specified element <tt>e</tt> to this set if the set contains no element <tt>e2</tt> such that <tt>(e==null ? e2==null : e.equals(e2))</tt>. If this set already contains the element, the call leaves the set u... |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
private byte[] calculateHMAC(byte[] macKey,byte[] additionalAuthenticatedData,byte[] initializationVector,byte[] cipherText,byte[] al){
try {
byte[] hmacInput=encryptUtil.concatenateByteArrays(additionalAuthenticatedData,initializationVector,cipherText,al);
return encryptUtil.calculateHmac(macKey,hmacInput);
... | Calculates HMAC over the data |
void trackHorizontalMotionScroll(int deltaX){
if (getChildCount() == 0) {
return;
}
boolean toLeft=deltaX < 0;
int limitedDeltaX=getHorizontalLimitedMotionScrollAmount(toLeft,deltaX);
if (limitedDeltaX != deltaX) {
mFlingRunnable.endFling(false);
onFinishedMovement();
}
offsetChildrenLeftAndRi... | Tracks a motion scroll. In reality, this is used to do just about any movement to items (touch scroll, arrow-key scroll, set an item as selected). |
public Vector3 crs(Vector3 vector){
return this.set(y * vector.z - z * vector.y,z * vector.x - x * vector.z,x * vector.y - y * vector.x);
}
| Sets this vector to the cross product between it and the other vector. |
@Override public boolean connectionAllowed(String eventName){
return false;
}
| Returns true if, at this time, the object will accept a connection via the named event |
public VMRegionVersionVector(){
super();
}
| for deserialization |
@Override public void handleFatalError(Runnable callingThread,String message,Throwable error){
if (callingThread instanceof Connector) {
Connector connector=(Connector)callingThread;
removeSocket(connector.getListenAddress(),connector.getRemoteAddress());
logger.log(Level.WARNING,"Removing connector:" + c... | Clears the faulty thread and reports the problem. |
public SearchSourceBuilder aggregations(BytesReference aggregationsBinary){
this.aggregationsBinary=aggregationsBinary;
return this;
}
| Sets a raw (xcontent / json) addAggregation. |
public boolean isClosable(){
return closable;
}
| Returns whether this <code>JInternalFrame</code> can be closed by some user action. |
public static <T>Iterator<T> sort(Iterator<T> self,Comparator<T> comparator){
return sort((Iterable<T>)toList(self),true,comparator).listIterator();
}
| Sorts the given iterator items into a sorted iterator using the comparator. The original iterator will become exhausted of elements after completing this method call. A new iterator is produced that traverses the items in sorted order. |
public AnnotationVisitor visitAnnotation(String desc,boolean visible){
if (mv != null) {
return mv.visitAnnotation(desc,visible);
}
return null;
}
| Visits an annotation of this method. |
public void insertUpdate(DocumentEvent e){
if (getUpdatePolicy() == NEVER_UPDATE || (getUpdatePolicy() == UPDATE_WHEN_ON_EDT && !SwingUtilities.isEventDispatchThread())) {
if ((e.getOffset() <= dot || e.getOffset() <= mark) && selectionTag != null) {
try {
component.getHighlighter().changeHighlight(... | Updates the dot and mark if they were changed by the insertion. |
public VNXeCommandResult createFileSystemSync(CreateFileSystemParam param) throws VNXeException {
_url=URL_CREATE;
return postRequestSync(param);
}
| create file system with sync call |
public static Date max(Date d1,Date d2){
if (d1 == null && d2 == null) return null;
if (d1 == null) return d2;
if (d2 == null) return d1;
return (d1.after(d2)) ? d1 : d2;
}
| Returns the maximum of two dates. A null date is treated as being less than any non-null date. |
private IJavaCompletionProposal[] codeComplete(String qualifiedTypeName,String snippet,CompletionProposalCollector requestor) throws JavaModelException {
IJavaCompletionProposal[] proposals=new IJavaCompletionProposal[0];
IType type=cu.getJavaProject().findType(qualifiedTypeName);
if (type != null) {
boolean ... | Collects the proposals generated at the end of the specified snippet of Java code, scoped to the specific type. |
public void clearAccessibleSelection(){
MenuElement old[]=MenuSelectionManager.defaultManager().getSelectedPath();
if (old != null) {
for (int j=0; j < old.length; j++) {
if (old[j] == JMenu.this) {
MenuElement me[]=new MenuElement[j + 1];
System.arraycopy(old,0,me,0,j);
me[j]=JMen... | Clears the selection in the object, so that nothing in the object is selected. This will close any open sub-menu. |
public void onTextTrackEnabledChanged(boolean isEnabled){
LOGD(TAG,"onTextTrackEnabledChanged() reached");
if (!isEnabled) {
setActiveTrackIds(new long[]{});
}
for ( VideoCastConsumer consumer : mVideoConsumers) {
consumer.onTextTrackEnabledChanged(isEnabled);
}
}
| Signals a change in the Text Track on/off state. Clients should not call this directly. |
protected static CharArraySet loadStopwordSet(Path stopwords) throws IOException {
Reader reader=null;
try {
reader=Files.newBufferedReader(stopwords,StandardCharsets.UTF_8);
return WordlistLoader.getWordSet(reader);
}
finally {
IOUtils.close(reader);
}
}
| Creates a CharArraySet from a path. |
private void readObjectContainer() throws Exception {
Element objectElement=getFirstElementByTagName(document,dsElement(Constants._TAG_OBJECT));
objectContainer=new ObjectContainer(objectElement,BASE_URI);
}
| Reads the object container element from the document. |
@SuppressWarnings("resource") protected ByteBufferIndexInput newCloneInstance(String newResourceDescription,ByteBuffer[] newBuffers,int offset,long length){
if (newBuffers.length == 1) {
newBuffers[0].position(offset);
return new SingleBufferImpl(newResourceDescription,newBuffers[0].slice(),length,chunkSizePo... | Factory method that creates a suitable implementation of this class for the given ByteBuffers. |
public final int length(){
return getView().length();
}
| Returns the length, in characters, of the text managed by this TextView |
public static void main(String[] args){
Jedis flush_jedis=new Jedis("localhost");
flush_jedis.select(1);
List<String> campaigns=new ArrayList<String>();
for (int i=0; i < 100; i++) {
campaigns.add(UUID.randomUUID().toString());
}
long campaignUpdates=0;
StandaloneThroughputLogger stl=new StandaloneThr... | Very simple test to see how fast Redis can go |
public ActiveMQRAMessage(final Message message,final ActiveMQRASession session){
if (ActiveMQRAMessage.trace) {
ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", "+ session+ ")");
}
this.message=message;
this.session=session;
}
| Create a new wrapper |
private byte readByte() throws IOException {
return in.readByte();
}
| Read a byte. |
public void printElement(Element element){
boolean hasChildren=element.hasChildNodes();
startTag(element,hasChildren);
if (hasChildren) {
boolean prevWasText=false;
NodeList children=element.getChildNodes();
for (int i=0; i < children.getLength(); i++) {
Node node=children.item(i);
if (nod... | Prints the given element. |
public KernelCount[][] computeMatchesForEachObservations(boolean giveListOfCorrelatedPoints) throws Exception {
KernelCount[][] counts=new KernelCount[totalObservations][4];
for (int b=0; b < totalObservations; b++) {
int[] intCounts=getCounts(destNextPastSourceVectors[b],b);
counts[b]=new KernelCount[4];
... | <p>Computes the probability counts for each previously supplied observations</p> <p>Implemented primarily for debug purposes</p> |
public String toString(){
return str;
}
| Returns a field name in English. This method is intended to be used for debugging/diagnosis and not for display to end-users. |
public List<byte[]> hvals(final byte[] key){
checkIsInMulti();
client.hvals(key);
final List<byte[]> lresult=client.getBinaryMultiBulkReply();
return lresult;
}
| Return all the values in a hash. <p> <b>Time complexity:</b> O(N), where N is the total number of entries |
public synchronized void onProcessingResource(final Resource resource){
totalResources++;
log.debug("processing resource: " + resource.getUri());
if (isLogRequired()) {
log.info("Processed until now: " + getTotalResources() + ". Last processed: "+ resource.getUri());
updateLastInvocation();
}
}
| A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources. |
public synchronized void log(Level msgLevel,String sourceClass,String sourceMethod,String msg,Throwable thrown){
LogRecord record=new LogRecord(msgLevel,msg);
record.setSourceClassName(sourceClass);
record.setSourceMethodName(sourceMethod);
record.setThrown(thrown);
log(record);
}
| Log a message, specifying source class and method, with associated Throwable information. |
public static void main(final String[] args){
DOMTestCase.doMain(hc_nodereplacechildnewchilddiffdocument.class,args);
}
| Runs this test from the command line. |
public DistributedLogClientBuilder serverSets(ServerSet local,ServerSet... remotes){
DistributedLogClientBuilder newBuilder=newBuilder(this);
RoutingService.Builder[] builders=new RoutingService.Builder[remotes.length + 1];
builders[0]=RoutingUtils.buildRoutingService(local);
for (int i=1; i < builders.length; ... | Server Sets to access proxy services. The <i>local</i> server set will be tried first, then <i>remotes</i>. |
public static void clearTabContext(Properties ctx,int WindowNo,int TabNo){
if (ctx == null) throw new IllegalArgumentException("Require Context");
Object[] keys=ctx.keySet().toArray();
for (int i=0; i < keys.length; i++) {
String tag=keys[i].toString();
if (tag.startsWith(WindowNo + "|" + TabNo+ "|") &&... | Clean up context for Window Tab (i.e. delete it). Please note that this method is not clearing the tab info context (i.e. _TabInfo). |
public static StyledString styleDecoratedString(String decoratedString,StyledString.Styler decorationStyler,StyledString styledString){
String label=styledString.getString();
int originalStart=decoratedString.indexOf(label);
if (originalStart == -1) {
return new StyledString(decoratedString);
}
if (decora... | Applies decoration styles to the decorated string and adds the styles of the previously undecorated string. <p> If the <code>decoratedString</code> contains the <code>styledString</code>, then the result keeps the styles of the <code>styledString</code> and styles the decorations with the <code>decorationStyler</code>.... |
protected List<Field> allFields(final Class<?> c){
List<Field> l=fieldsCache.get(c);
if (l == null) {
l=new LinkedList<Field>();
final Field[] fields=c.getDeclaredFields();
addAll(l,fields);
Class<?> sc=c;
while ((sc=sc.getSuperclass()) != Object.class && sc != null) {
addAll(l,sc.getDecla... | reflection utils, override this to choose which fields to clone |
public CertificateEncodingException(){
super();
}
| Constructs a CertificateEncodingException with no detail message. A detail message is a String that describes this particular exception. |
public void testGetWord(){
Word result=service.getWord(customizationId,"string").execute();
assertNotNull(result);
}
| Test get word. |
protected SelectedSparseObjectMatrix2D(int rows,int columns,AbstractIntObjectMap elements,int rowZero,int columnZero,int rowStride,int columnStride,int[] rowOffsets,int[] columnOffsets,int offset){
setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
this.elements=elements;
this.rowOffsets=rowOffsets;
... | Constructs a matrix view with the given parameters. |
@Override public void doPreExplode(){
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this.exploder,position.xPos,position.yPos,position.zPos,4F,true);
this.lightBeam=new EntityLightBeam(this.worldObj,position,20 * 20,this.red,this.green,this.blue);
this.worldObj.spawnEntityInWorld(this.light... | Called before an explosion happens |
public void write(AnnotationsWriter writer) throws IOException {
writer.constValueIndex(getValue());
}
| Writes the value. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.