code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
public Quaternionf rotateLocalZ(float angle){
return rotateLocalZ(angle,this);
}
| Apply a rotation to <code>this</code> quaternion rotating the given radians about the local z axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>R * Q</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>R * Q * v</code>, the rotation represented by <code>this</code> will be applied first! |
public static void fill(boolean[] a,boolean val){
for (int i=0, len=a.length; i < len; i++) a[i]=val;
}
| Assigns the specified boolean value to each element of the specified array of booleans. |
@Override public boolean forceFocus(){
this.checkWidget();
return this.text.forceFocus();
}
| Forces the receiver to have the <em>keyboard focus</em>, causing all keyboard events to be delivered to it. |
public InactiveController(Game game,String title,boolean canBeTakenOver){
super(new GameCursor(game,GameCursor.Mode.MakeMovesOnCursor));
cursor=(GameCursor)getGame();
this.title=title;
this.canBeTakenOver=canBeTakenOver;
}
| You can set the PgnHeader WhiteOnTop to toggle if white should be displayed on top or not. |
public BillingAdapterNotFoundException(Object[] params){
super(params);
}
| Constructs a new exception with the specified message parameters. |
@Deprecated public void listNotebooksAsync(final OnClientCallback<List<LinkedNotebook>> callback){
AsyncReflector.execute(getAsyncPersonalClient(),callback,"listNotebooks",getAuthenticationToken());
}
| Helper method to list linked/business notebooks asynchronously. |
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:15.095 -0500",hash_original_method="12F43AAD192527EE14BD9EA92E6F05B8",hash_generated_method="929C3DCA2A88B94727C182DEFD173D7E") @Override public Drawable mutate(){
if (!mMutated && super.mutate() == this) {
mBitmapState=new BitmapState(mBitmapState);
mMutated=true;
}
return this;
}
| A mutable BitmapDrawable still shares its Bitmap with any other Drawable that comes from the same resource. |
private static boolean hasSpecializedHandlerIntents(Context context,Intent intent){
try {
PackageManager pm=context.getPackageManager();
List<ResolveInfo> handlers=pm.queryIntentActivities(intent,PackageManager.GET_RESOLVED_FILTER);
if (handlers == null || handlers.size() == 0) {
return false;
}
for ( ResolveInfo resolveInfo : handlers) {
IntentFilter filter=resolveInfo.filter;
if (filter == null) continue;
if (filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0) continue;
if (resolveInfo.activityInfo == null) continue;
return true;
}
}
catch ( RuntimeException e) {
Log.e(TAG,"Runtime exception while getting specialized handlers");
}
return false;
}
| Used to check whether there is a specialized handler for a given intent. |
public OIDCTokens acquireTokensByGSS(GSSNegotiationHandler gssNegotiationHandler,TokenSpec tokenSpec) throws OIDCClientException, OIDCServerException, TokenValidationException, SSLConnectionException {
Validate.notNull(gssNegotiationHandler,"gssNegotiationHandler");
Validate.notNull(tokenSpec,"tokenSpec");
HttpResponse httpResponse=OIDCClientUtils.negotiateGssResponse(gssNegotiationHandler,tokenSpec,getTokenEndpointURI(),this.clientId,this.holderOfKeyConfig,this.keyStore,UUID.randomUUID().toString());
return OIDCClientUtils.parseTokenResponse(httpResponse,this.providerPublicKey,this.issuer,this.clientId,this.clockToleranceInSeconds);
}
| Get tokens by GSSNegotiationHandler which handles multi-legged GSSTicketGrant |
public static double CCrawFitness(boolean useTrainingData,GEPIndividual ind,int chromosomeNum){
double expectedResult;
double predictedValue;
GEPDependentVariable dv;
if (useTrainingData) dv=GEPDependentVariable.trainingData;
else dv=GEPDependentVariable.testingData;
double dvValues[]=dv.getDependentVariableValues(chromosomeNum);
double dvVariance=dv.getDependentVariableVariance(chromosomeNum);
double dvMean=dv.getDependentVariableMean(chromosomeNum);
double dvStdDev=Math.sqrt(dvVariance);
double sumOfPredictedValues=0.0;
double predictedValues[]=new double[dvValues.length];
for (int i=0; i < dvValues.length; i++) {
predictedValues[i]=ind.eval(chromosomeNum,useTrainingData,i);
sumOfPredictedValues+=predictedValues[i];
}
double meanOfPredictedValues=sumOfPredictedValues / dvValues.length;
double sum1=0.0;
double sum2=0.0;
for (int i=0; i < dvValues.length; i++) {
expectedResult=dvValues[i];
predictedValue=predictedValues[i];
double diff=(predictedValue - meanOfPredictedValues);
sum1+=(expectedResult - dvMean) * (diff);
sum2+=diff * diff;
}
double covariance=sum1 / dvValues.length;
double stdDev=Math.sqrt(sum2 / dvValues.length);
double cc=covariance / (dvStdDev * stdDev);
return Math.min(1.0,Math.max(cc,-1.0));
}
| Calculates the 'raw' fitness for the CC (Correlation Coefficient) type fitness (before the normalization from 0 to max value is done). |
public static boolean isInCircleRobust(Coordinate a,Coordinate b,Coordinate c,Coordinate p){
return isInCircleNormalized(a,b,c,p);
}
| Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). This method uses more robust computation. |
public int lastIndexOfAnyOf(final char[] c,final int from){
final int n=c.length;
if (from < 0) return -1;
if (n == 0) return -1;
if (n == 1) return lastIndexOf(c[0],from);
return lastIndexOfAnyOf(c,n,from,buildFilter(c,n));
}
| Returns the index of the last occurrence of any of the specified characters, searching backwards starting at the specified index. <P>This method uses a Bloom filter to avoid repeated linear scans of the array <code>c</code>; however, this optimisation will be most effective with arrays of less than twenty characters, and, in fact, will very slightly slow down searches for more than one hundred characters. |
public void tryToScrollTo(int to,int duration){
if (mPtrIndicator.isAlreadyHere(to)) {
return;
}
mStart=mPtrIndicator.getCurrentPosY();
mTo=to;
int distance=to - mStart;
if (DEBUG) {
PtrCLog.d(LOG_TAG,"tryToScrollTo: start: %s, distance:%s, to:%s",mStart,distance,to);
}
removeCallbacks(this);
mLastFlingY=0;
if (!mScroller.isFinished()) {
mScroller.forceFinished(true);
}
mScroller.startScroll(0,0,0,distance,duration);
post(this);
mIsRunning=true;
}
| If not in target position, let Scroller start scroll to destination. |
public boolean isReadOnly(final int column) throws SQLException {
return false;
}
| Indicates whether the designated column is definitely not writable. |
public static long[] transformLongArray(Long[] source){
long[] destin=new long[source.length];
for (int i=0; i < source.length; i++) {
destin[i]=source[i];
}
return destin;
}
| convert Long array to long array |
public Builder backgroundColor(int sliderBackgroundColor){
return this;
}
| Set the background color for the Slider. This is the view containing the list. |
public static Breadcrumbs addBreadcrumb(Breadcrumbs pBreadcrumbs,String title,String url){
Breadcrumbs breadcrumbs=new Breadcrumbs();
if (pBreadcrumbs != null) breadcrumbs.addAll(pBreadcrumbs);
breadcrumbs.add(new Breadcrumb(title,url));
return breadcrumbs;
}
| Take a set of breadcrumbs, and make a copy with a new one added at the end |
private boolean isDetalleDisponible(DetalleConsultaVO detalleConsulta,Date fechaInicial,Date fechaFinal,boolean isReserva){
int disponible=isDetalleDisponibleAllConditions(detalleConsulta,fechaInicial,fechaFinal,isReserva);
return (disponible == SolicitudesConstants.ESTADO_DISPONIBILIDAD_DETALLE_DISPONIBLE || disponible == SolicitudesConstants.ESTADO_DISPONIBILIDAD_DETALLE_DISPONIBLE_PARCIAL);
}
| Comprueba la disponibilidad de una unidad documental |
public static boolean isSameLocalTime(final Calendar cal1,final Calendar cal2){
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The date must not be null");
}
return (cal1.get(Calendar.MILLISECOND) == cal2.get(Calendar.MILLISECOND) && cal1.get(Calendar.SECOND) == cal2.get(Calendar.SECOND) && cal1.get(Calendar.MINUTE) == cal2.get(Calendar.MINUTE) && cal1.get(Calendar.HOUR_OF_DAY) == cal2.get(Calendar.HOUR_OF_DAY) && cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.getClass() == cal2.getClass());
}
| <p>Checks if two calendar objects represent the same local time.</p> <p>This method compares the values of the fields of the two objects. In addition, both calendars must be the same of the same type.</p> |
public VfsStream(InputStream is){
init(is,null);
}
| Create a new VfsStream based on the java.io.* stream. |
private PartitionKeyGroup createPartitionKeyGroupFromEntity(PartitionKeyGroupEntity partitionKeyGroupEntity){
PartitionKeyGroup partitionKeyGroup=new PartitionKeyGroup();
PartitionKeyGroupKey partitionKeyGroupKey=new PartitionKeyGroupKey();
partitionKeyGroup.setPartitionKeyGroupKey(partitionKeyGroupKey);
partitionKeyGroupKey.setPartitionKeyGroupName(partitionKeyGroupEntity.getPartitionKeyGroupName());
return partitionKeyGroup;
}
| Creates the partition key group from the persisted entity. |
public void addNode(BezierPath.Node p){
addNode(getNodeCount(),p);
}
| Adds a control point. |
public int readInt() throws IOException {
expectStartTag("int");
int value=parseInt();
expectEndTag("int");
return value;
}
| Reads an integer value from the input stream. |
public void pauseTransfer() throws RcsPermissionDeniedException, RcsGenericException {
try {
mTransferInf.pauseTransfer();
}
catch ( Exception e) {
RcsPermissionDeniedException.assertException(e);
RcsUnsupportedOperationException.assertException(e);
throw new RcsGenericException(e);
}
}
| Pauses the file transfer |
public static void addChemicalDissolutionChamberRecipe(ItemStack input,GasStack output){
try {
Class recipeClass=Class.forName("mekanism.common.recipe.RecipeHandler");
Method m=recipeClass.getMethod("addChemicalDissolutionChamberRecipe",ItemStack.class,GasStack.class);
m.invoke(null,input,output);
}
catch ( Exception e) {
System.err.println("Error while adding recipe: " + e.getMessage());
}
}
| Add a Chemical Dissolution Chamber recipe. |
public static String resolveResourceId(Request restletReq){
String resourceId=restletReq.getResourceRef().getRelativeRef(restletReq.getRootRef().getParentRef()).getPath(DECODE);
if (!resourceId.startsWith("/")) resourceId="/" + resourceId;
return resourceId;
}
| Determines the ManagedResource resourceId from the Restlet request. |
private void executeRemove(String[] args) throws IOException, ServiceException, DocumentListException {
if (args.length == 3) {
documentList.removeFromFolder(args[1],args[2]);
}
else {
printMessage(COMMAND_HELP_REMOVE);
}
}
| Execute the "remove" command. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public Builder addListener(Listener listener){
getListenerManager().addListener(listener);
return this;
}
| Add a listener to the current ListenerManager |
public TransportOrder(String transportUnitBK){
this.transportUnitBK=transportUnitBK;
}
| Create a TransportOrder with the given TransportUnit's business key. |
public static boolean isATarget(final AnnotatedTypeMirror type,final Set<TypeVariable> targetTypeVars){
return type.getKind() == TypeKind.TYPEVAR && targetTypeVars.contains(type.getUnderlyingType());
}
| Given a set of type variables for which we are inferring a type, returns true if type is a use of a type variable in the list of targetTypeVars. |
protected void checkDirExists(String dir){
String path=getFileHandler().append(getHome(),dir);
boolean exists=getFileHandler().exists(path);
if (!exists) {
throw new ContainerException("Invalid existing configuration: directory [" + path + "] does not exist in JONAS_BASE");
}
}
| Check if the directory exists. |
public MultiViewParallaxTransformer withoutParallaxView(final int id){
parallaxFactors.remove(id);
return this;
}
| Removes any existing parallax effect from all Views with the provided resource id. It is recommended that this method not be called while the Views are being transformed. |
void toXml(final OutputStream stream){
xstream().toXML(this,stream);
}
| Writes this instance to XML. |
boolean inSameSubroutine(final Label block){
if ((status & VISITED) == 0 || (block.status & VISITED) == 0) {
return false;
}
for (int i=0; i < srcAndRefPositions.length; ++i) {
if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
return true;
}
}
return false;
}
| Returns true if this basic block and the given one belong to a common subroutine. |
private boolean isLeaseHeldBy(InternalDistributedMember sender,int lockId){
Assert.assertTrue(sender != null,"sender is null: " + this);
Assert.assertTrue(lockId > -1,"lockId is < 0: " + this);
return sender.equals(this.lessee) && lockId == this.leaseId;
}
| Returns true if the sender holds a lease on this lock using lockId. <p> Caller must synchronize on this grant token. |
void receive(MultiplexedDatagramSocket multiplexed,DatagramPacket p) throws IOException {
multiplexingXXXSocketSupport.receive(multiplexed.received,p,multiplexed.getSoTimeout());
}
| Receives a <tt>DatagramPacket</tt> from this <tt>DatagramSocket</tt> upon request from a specific <tt>MultiplexedDatagramSocket</tt>. |
public boolean isNumCpuReadonly(){
return numCpuReadonly;
}
| Gets the value of the numCpuReadonly property. |
protected void notifySuccess(Object... values){
Method[] methodsArray=onSuccessCallback.get().getClass().getMethods();
if (methodsArray.length > 0) {
Method methodToInvoke=UseCaseFilter.filterValidMethodArgs(values,methodsArray,Success.class);
invokeMethodInTheCallbackScheduler(methodToInvoke,values);
}
else {
throw new IllegalStateException("The OnSuccessCallback instance configured has no methods annotated with the " + "@Success annotation.");
}
}
| Notify to the callback onSuccessCallback that the use case has worked fine. You can invoke the method as many times as you want. You only need on your onSuccessCallback a method with the same arguments. |
public VersionProvider(final HttpMethodClient<ErrorResponseDeserializerUnion> httpClient){
this.httpClient=httpClient;
}
| Creates a new version provider. |
private static void selectNodes(final ZyGraph graph,final Set<CTag> tags,final boolean mustBeVisible){
final Collection<NaviNode> nodes;
if (mustBeVisible) {
nodes=GraphHelpers.filter(graph,new CGraphNodeTaggedFilter(tags));
}
else {
nodes=GraphHelpers.filter(graph,new CGraphNodeTaggedAndVisibleFilter(tags));
}
graph.selectNodes(nodes,true);
}
| Selects the nodes of a graph that are selected with the given tags. |
public void stripLast(){
String s=(String)strings.get(count - 1);
if (s.charAt(s.length() - 1) != ' ') return;
length--;
if (s.length() == 1) {
attributes.remove(--count);
strings.remove(count);
return;
}
strings.set(count - 1,s.substring(0,s.length() - 1));
}
| Strips the last string character. |
public void updateStateColors(){
int page=pager.getCurrentItem();
ConversationPagerAdapter adapter=(ConversationPagerAdapter)pager.getAdapter();
Conversation conversation=adapter.getItem(page);
Conversation previousConversation=server.getConversation(server.getSelectedConversation());
if (previousConversation != null) {
previousConversation.setStatus(Conversation.STATUS_DEFAULT);
}
if (conversation.getNewMentions() > 0) {
Context context=pager.getContext();
Intent intent=new Intent(context,IRCService.class);
intent.setAction(IRCService.ACTION_ACK_NEW_MENTIONS);
intent.putExtra(IRCService.EXTRA_ACK_SERVERID,server.getId());
intent.putExtra(IRCService.EXTRA_ACK_CONVTITLE,conversation.getName());
context.startService(intent);
}
conversation.setStatus(Conversation.STATUS_SELECTED);
server.setSelectedConversation(conversation.getName());
if (page - 2 >= 0) {
int color=stateProvider.getColorForLowerThan(page - 1);
leftIndicatorView.setBackgroundColor(color);
leftIndicatorView.setVisibility(color == ConversationPagerAdapter.COLOR_NONE ? View.INVISIBLE : View.VISIBLE);
}
else {
leftIndicatorView.setVisibility(View.INVISIBLE);
}
if (page + 2 < adapter.getCount()) {
int color=stateProvider.getColorForGreaterThan(page + 1);
rightIndicatorView.setBackgroundColor(color);
rightIndicatorView.setVisibility(color == ConversationPagerAdapter.COLOR_NONE ? View.INVISIBLE : View.VISIBLE);
}
else {
rightIndicatorView.setVisibility(View.INVISIBLE);
}
titleIndicator.invalidate();
}
| Update the colors of the state indicators. |
public boolean[][] toBooleanArray2(){
boolean[][] array=new boolean[rows][columns];
for (int r=0; r < rows; r++) {
for (int c=0; c < columns; c++) {
array[r][c]=get(r,c) != 0.0 ? true : false;
}
}
return array;
}
| Convert the matrix to a two-dimensional array of boolean values. |
public void updateActionLinks(RichNotificationActionLink... actionLinks){
LinearLayout actionLinksContainer=(LinearLayout)findViewById(R.id.view_rich_notification_action_links);
boolean gotActionLinks=false;
if (actionLinks != null && actionLinks.length > 0) {
gotActionLinks=true;
actionLinksContainer.setVisibility(View.INVISIBLE);
while (actionLinksContainer.getChildCount() > 0) {
actionLinksContainer.getChildAt(0).setOnClickListener(null);
actionLinksContainer.removeViewAt(0);
}
for ( RichNotificationActionLink actionLink : actionLinks) {
View v=actionLink.getView();
if (v != null) {
actionLinksContainer.addView(v);
((LinearLayout.LayoutParams)v.getLayoutParams()).setMargins(actionLinksHorizontalMargin,0,actionLinksHorizontalMargin,0);
v.requestLayout();
}
}
}
actionLinksContainer.setVisibility(gotActionLinks ? View.VISIBLE : View.GONE);
}
| Removes all previous action links if they were there and adds the corresponding TextViews. |
static public void assertTopAligned(View first,View second){
int[] xy=new int[2];
first.getLocationOnScreen(xy);
int firstTop=xy[1];
second.getLocationOnScreen(xy);
int secondTop=xy[1];
assertEquals("views are not top aligned",firstTop,secondTop);
}
| Assert that two views are top aligned, that is that their top edges are on the same y location. |
public static int[] createMaterialSpectrumPalette(int color,final int count){
int[] palette=new int[count];
if (count > 0) {
final boolean isDarkColor=isDarkColor(color);
final float[] opacity=isDarkColor ? new float[]{.75f,.50f,.25f,.10f,.85f,.75f,.50f,.25f} : new float[]{.85f,.75f,.50f,.25f,.75f,.50f,.25f,.10f};
for (int i=0; i < count; i++) {
final int op=i % opacity.length;
int mask=(isDarkColor && op < 4) || (!isDarkColor && op >= 4) ? Color.WHITE : Color.BLACK;
float alpha=opacity[op];
palette[i]=applyMaskColor(color,mask,alpha);
}
}
return palette;
}
| Create an spectrum color palette from a base color. Max 8 colors; after that color are filled but with a reused color. |
public double eval(double params[]){
return (1.0 / Math.tan(params[0]));
}
| Evaluate the cotangent of a single parameter. |
protected final void throwException(Exception exception) throws ParserException {
throw new ParserException(getContext(),exception.getMessage());
}
| Shortcut to throw a correctly formed ParserException, getting the message from an existing exception. |
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
java.lang.String prefix=xmlWriter.getPrefix(namespace);
if (prefix == null) {
prefix=generatePrefix(namespace);
while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
prefix=org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
}
xmlWriter.writeNamespace(prefix,namespace);
xmlWriter.setPrefix(prefix,namespace);
}
return prefix;
}
| Register a namespace prefix |
@Override public void println(int priority,String tag,String msg,Throwable tr){
String useMsg=msg;
if (useMsg == null) {
useMsg="";
}
if (tr != null) {
msg+="\n" + Log.getStackTraceString(tr);
}
Log.println(priority,tag,useMsg);
if (mNext != null) {
mNext.println(priority,tag,msg,tr);
}
}
| Prints data out to the console using Android's native log mechanism. |
@Override public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.search_query_results);
mQueryText=(TextView)findViewById(R.id.txt_query);
mAppDataText=(TextView)findViewById(R.id.txt_appdata);
mDeliveredByText=(TextView)findViewById(R.id.txt_deliveredby);
final Intent queryIntent=getIntent();
final String queryAction=queryIntent.getAction();
if (Intent.ACTION_SEARCH.equals(queryAction)) {
doSearchQuery(queryIntent,"onCreate()");
}
else {
mDeliveredByText.setText("onCreate(), but no ACTION_SEARCH intent");
}
}
| Called with the activity is first created. After the typical activity setup code, we check to see if we were launched with the ACTION_SEARCH intent, and if so, we handle it. |
protected long unwrapKey(Object key){
return ((Long)key).longValue();
}
| Unwraps a key |
private static List<TypeRecord> recursiveDepthFirstSearch(final Stack<TypeRecord> pathFromRoot,final TypeElement target,final Types types){
List<TypeRecord> path=null;
if (!pathFromRoot.isEmpty()) {
final TypeRecord currentRecord=pathFromRoot.peek();
final TypeElement currentElement=currentRecord.element;
if (currentElement.equals(target)) {
return new ArrayList<>(pathFromRoot);
}
else {
final Iterator<? extends TypeMirror> interfaces=currentElement.getInterfaces().iterator();
final TypeMirror superclassType=currentElement.getSuperclass();
while (path == null && interfaces.hasNext()) {
final TypeMirror intface=interfaces.next();
if (intface.getKind() != TypeKind.NONE) {
DeclaredType interfaceDeclared=(DeclaredType)intface;
pathFromRoot.push(new TypeRecord((TypeElement)types.asElement(interfaceDeclared),interfaceDeclared));
path=recursiveDepthFirstSearch(pathFromRoot,target,types);
pathFromRoot.pop();
}
}
if (path == null && superclassType != null && superclassType.getKind() != TypeKind.NONE) {
final DeclaredType superclass=(DeclaredType)superclassType;
pathFromRoot.push(new TypeRecord((TypeElement)types.asElement(superclass),superclass));
path=recursiveDepthFirstSearch(pathFromRoot,target,types);
pathFromRoot.pop();
}
}
}
return path;
}
| Computes one level for depthFirstSearchForSupertype then recurses. |
private void ItoOSP(int i,byte[] sp){
sp[0]=(byte)(i >>> 24);
sp[1]=(byte)(i >>> 16);
sp[2]=(byte)(i >>> 8);
sp[3]=(byte)(i >>> 0);
}
| int to octet string. |
String findParmValue(Element e,String name){
List<Element> l=e.getChildren("parameter");
for (int i=0; i < l.size(); i++) {
Element n=l.get(i);
if (n.getAttributeValue("name").equals(name)) {
return n.getTextTrim();
}
}
return null;
}
| Service routine to look through "parameter" child elements to find a particular parameter value |
public void println(long x){
printHeader();
for (int i=0; i < size(); i++) ((PrintStream)m_Streams.get(i)).println(x);
flush();
}
| prints the given long to the streams. |
public boolean isColumnNumeric(int columnIndex){
return getSource().isColumnNumeric(columnIndex);
}
| Returns whether the column at the specified index contains numbers. |
public void union(Rect r){
union(r.left,r.top,r.right,r.bottom);
}
| Update this Rect to enclose itself and the specified rectangle. If the specified rectangle is empty, nothing is done. If this rectangle is empty it is set to the specified rectangle. |
public void label(Way way,EnumSet<EdgeStore.EdgeFlag> forwardFlags,EnumSet<EdgeStore.EdgeFlag> backFlags){
if (!forwardFlags.contains(EdgeStore.EdgeFlag.ALLOWS_CAR) && !backFlags.contains(EdgeStore.EdgeFlag.ALLOWS_CAR)) {
forwardFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_1);
backFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_1);
return;
}
if (way.hasTag("highway","service")) return;
if (way.hasTag("highway","residential") || way.hasTag("highway","living_street")) {
forwardFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_1);
backFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_1);
return;
}
boolean hasForwardLane=false;
boolean hasBackwardLane=false;
if (way.hasTag("cycleway","lane")) {
hasForwardLane=hasBackwardLane=true;
}
if (way.hasTag("cycleway:left","lane") || way.hasTag("cycleway","opposite") || way.hasTag("cycleway:right","opposite")) {
hasBackwardLane=true;
}
if (way.hasTag("cycleway:left","opposite") || way.hasTag("cycleway:right","lane")) {
hasForwardLane=true;
}
double maxSpeed=Double.NaN;
if (way.hasTag("maxspeed")) {
maxSpeed=getSpeedKmh(way.getTag("maxspeed"));
if (Double.isNaN(maxSpeed)) {
LOG.warn("Unable to parse maxspeed tag {}",way.getTag("maxspeed"));
}
}
int lanes=Integer.MAX_VALUE;
if (way.hasTag("lanes")) {
try {
lanes=Integer.parseInt(way.getTag("lanes"));
}
catch ( NumberFormatException e) {
LOG.warn("Unable to parse lane specification {}",way.getTag("lanes"));
}
}
EdgeStore.EdgeFlag defaultLts=EdgeStore.EdgeFlag.BIKE_LTS_3;
if (lanes <= 3 && maxSpeed <= 25 * 1.61) defaultLts=EdgeStore.EdgeFlag.BIKE_LTS_2;
if (lanes == Integer.MAX_VALUE && maxSpeed <= 25 * 1.61) defaultLts=EdgeStore.EdgeFlag.BIKE_LTS_2;
if (way.hasTag("highway","unclassified") || way.hasTag("highway","tertiary") || way.hasTag("highway","tertiary_link")) {
if (lanes <= 3 && Double.isNaN(maxSpeed)) defaultLts=EdgeStore.EdgeFlag.BIKE_LTS_2;
if (hasForwardLane) {
forwardFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_2);
}
else {
forwardFlags.add(defaultLts);
}
if (hasBackwardLane) {
backFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_2);
}
else {
backFlags.add(defaultLts);
}
}
else {
if (hasForwardLane) {
forwardFlags.add(defaultLts);
}
if (hasBackwardLane) {
backFlags.add(defaultLts);
}
}
if (!forwardFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_1) && !forwardFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_2) && !forwardFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_3)&& !forwardFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_4)) forwardFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_4);
if (!backFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_1) && !backFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_2) && !backFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_3)&& !backFlags.contains(EdgeStore.EdgeFlag.BIKE_LTS_4)) backFlags.add(EdgeStore.EdgeFlag.BIKE_LTS_4);
}
| Set the LTS for this way in the provided flags (not taking into account any intersection LTS at the moment) |
public void endTransfer(String fileName){
filesCount++;
long leftNotReported=currentFileSize - currentFileReal;
if (leftNotReported > 0) {
subMonitor.worked((int)leftNotReported);
}
long originalSize=files.get(fileName).longValue();
finishedFilesSize+=getFileSize(originalSize);
if (files.size() == filesCount) {
displayMessageJob.cancel();
subMonitor.subTask("");
subMonitor.done();
}
}
| Informs that the download of the file has ended. |
public synchronized void addSeries(int index,XYSeries series){
mSeries.add(index,series);
}
| Adds a new XY series to the list. |
public NumberConverter(boolean allowDecimals,Object defaultValue){
super();
this.allowDecimals=allowDecimals;
setDefaultValue(defaultValue);
}
| Construct a <code>java.lang.Number</code> <i>Converter</i> that returns a default value if an error occurs. |
public ActiveMQRAStreamMessage(final StreamMessage message,final ActiveMQRASession session){
super(message,session);
if (ActiveMQRAStreamMessage.trace) {
ActiveMQRALogger.LOGGER.trace("constructor(" + message + ", "+ session+ ")");
}
}
| Create a new wrapper |
private void writeAndFlushData(ZkDataNode node) throws KeeperException, InterruptedException {
String path=node.getFQPath();
if (ZKAccessUtils.zkPathExists(zkHandle,path)) {
logger.info("Path Exists: Setting data... " + path);
ZKAccessUtils.setDataOnZkNode(zkHandle,path,node.getNodeData());
}
else {
logger.info("Path does not exist. Creating now... " + path);
ZKAccessUtils.validateAndCreateZkPath(zkHandle,path,node.getNodeData());
}
for ( ZkDataNode child : node.getAllChildren()) {
writeAndFlushData(child);
}
}
| Create Path and Flush out Data for the corresponding Zookeeper node and its children. |
public FSFont resolveFont(SharedContext ctx,String[] families,float size,IdentValue weight,IdentValue style,IdentValue variant){
List<Font> fonts=new ArrayList<Font>(3);
if (families != null) {
for (int i=0; i < families.length; i++) {
Font font=resolveFont(ctx,families[i],size,weight,style,variant);
if (font != null) {
fonts.add(font);
}
}
}
String family="SansSerif";
if (style == IdentValue.ITALIC) {
family="Serif";
}
Font fnt=createFont(ctx,availableFontsHash.get(family),size,weight,style,variant);
instanceHash.put(getFontInstanceHashName(ctx,family,size,weight,style,variant),fnt);
fonts.add(fnt);
return new AWTFSFont(fonts,size);
}
| Resolves a list of font families. |
@Override public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ptr_list_fragment);
mPullRefreshListFragment=(PullToRefreshListFragment)getSupportFragmentManager().findFragmentById(R.id.frag_ptr_list);
mPullRefreshListView=mPullRefreshListFragment.getPullToRefreshListView();
mPullRefreshListView.setOnRefreshListener(this);
ListView actualListView=mPullRefreshListView.getRefreshableView();
mListItems=new LinkedList<String>();
mListItems.addAll(Arrays.asList(mStrings));
mAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,mListItems);
actualListView.setAdapter(mAdapter);
mPullRefreshListFragment.setListShown(true);
}
| Called when the activity is first created. |
private void makeToast(String message){
if (mToast != null) {
mToast.cancel();
}
mToast=Toast.makeText(this,message,Toast.LENGTH_LONG);
mToast.show();
}
| use to don't have toast queue |
@Action(value="/revPetition-addHearingDate") public String addHearingDate(){
if (LOGGER.isDebugEnabled()) LOGGER.debug("ObjectionAction | addHearingDate | start " + objection);
InputStream hearingNoticePdf=null;
ReportOutput reportOutput=new ReportOutput();
updateStateAndStatus(objection);
reportOutput=createHearingNoticeReport(reportOutput,objection);
if (reportOutput != null && reportOutput.getReportOutputData() != null) hearingNoticePdf=new ByteArrayInputStream(reportOutput.getReportOutputData());
if (hearingNoticePdf != null) noticeService.saveNotice(objection.getObjectionNumber(),objection.getObjectionNumber(),PropertyTaxConstants.NOTICE_TYPE_REVISIONPETITION_HEARINGNOTICE,objection.getBasicProperty(),hearingNoticePdf);
revisionPetitionService.updateRevisionPetition(objection);
sendEmailandSms(objection,REVISION_PETITION_HEARINGNOTICEGENERATED);
if (LOGGER.isDebugEnabled()) LOGGER.debug("ObjectionAction | addHearingDate | End " + objection);
return STRUTS_RESULT_MESSAGE;
}
| Method to add hearing date |
public CustomFaultResponse(){
requestFileName="getstate.query";
responseFile="customfault.answer";
}
| Constructs the test case. |
public int next(){
if (currentIndex < replaceable.length()) {
return replaceable.charAt(currentIndex++);
}
return DONE;
}
| Returns next UTF16 character and increments the iterator's currentIndex by 1. If the resulting currentIndex is greater or equal to the text length, the currentIndex is reset to the text length and a value of DONECODEPOINT is returned. |
@Override public boolean equals(Object obj){
if (obj == this) return true;
if (!(obj instanceof CodeSource)) return false;
CodeSource cs=(CodeSource)obj;
if (location == null) {
if (cs.location != null) return false;
}
else {
if (!location.equals(cs.location)) return false;
}
return matchCerts(cs,true);
}
| Tests for equality between the specified object and this object. Two CodeSource objects are considered equal if their locations are of identical value and if their signer certificate chains are of identical value. It is not required that the certificate chains be in the same order. |
public void endEntity(String name) throws SAXException {
if (null != m_resultLexicalHandler) m_resultLexicalHandler.endEntity(name);
}
| Report the end of an entity. |
public VolumeInput(Observer theObserver){
obs=new MyObservable();
obs.addObserver(theObserver);
}
| Creates new form CountInput |
protected SimpleScopeImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
void start(){
initializeServices();
startCustomExceptionHandler();
startLogListener();
startEventTracker();
}
| Start up Foam! |
public List<String> list(final String path) throws VaultException {
final String fullPath=path == null ? "list=true" : path + "?list=true";
LogicalResponse response=null;
try {
response=read(fullPath);
}
catch ( final VaultException e) {
if (e.getHttpStatusCode() != 404) {
throw e;
}
}
final List<String> returnValues=new ArrayList<>();
if (response != null && response.getRestResponse().getStatus() != 404 && response.getData() != null && response.getData().get("keys") != null) {
final JsonArray keys=Json.parse(response.getData().get("keys")).asArray();
for (int index=0; index < keys.size(); index++) {
returnValues.add(keys.get(index).asString());
}
}
return returnValues;
}
| <p>Retrieve a list of keys corresponding to key/value pairs at a given Vault path.</p> <p>Key values ending with a trailing-slash characters are sub-paths. Running a subsequent <code>list()</code> call, using the original path appended with this key, will retrieve all secret keys stored at that sub-path.</p> <p>This method returns only the secret keys, not values. To retrieve the actual stored value for a key, use <code>read()</code> with the key appended onto the original base path.</p> |
@Override public String fromURI(final URI uri){
if (uri == null) {
throw new IllegalArgumentException();
}
try {
return URLDecoder.decode(uri.getLocalName(),"UTF-8");
}
catch ( UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
| Round-trip a URI back into a graph element ID or property name. |
private void initializeLayout(){
setLayout(new BorderLayout());
JPanel basicsPanel=new JPanel(new GridBagLayout());
basicsPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
GridBagConstraints gbc=new GridBagConstraints();
gbc.anchor=GridBagConstraints.WEST;
gbc.fill=GridBagConstraints.HORIZONTAL;
if (displayIDInfo) {
gbc.weightx=0.8;
gbc.gridwidth=1;
gbc.gridx=0;
gbc.gridy=0;
gbc.insets=new Insets(5,0,0,0);
basicsPanel.add(new JLabel("Synapse Id:"),gbc);
gbc.gridwidth=2;
gbc.gridx=1;
basicsPanel.add(idLabel,gbc);
}
gbc.weightx=0.8;
gbc.gridwidth=1;
gbc.gridx=0;
gbc.gridy++;
basicsPanel.add(new JLabel("Strength:"),gbc);
gbc.anchor=GridBagConstraints.EAST;
gbc.insets=new Insets(5,3,0,0);
gbc.gridwidth=2;
gbc.weightx=0.2;
gbc.gridx=1;
basicsPanel.add(tfStrength,gbc);
gbc.anchor=GridBagConstraints.WEST;
gbc.insets=new Insets(5,0,0,0);
gbc.gridwidth=1;
gbc.weightx=0.8;
gbc.gridx=0;
gbc.gridy++;
basicsPanel.add(new JLabel("Status: "),gbc);
gbc.anchor=GridBagConstraints.EAST;
gbc.insets=new Insets(5,3,0,0);
gbc.gridwidth=2;
gbc.weightx=0.2;
gbc.gridx=1;
basicsPanel.add(synapseEnabled,gbc);
gbc.gridwidth=1;
int lgap=detailTriangle.isDown() ? 5 : 0;
gbc.insets=new Insets(10,5,lgap,5);
gbc.fill=GridBagConstraints.NONE;
gbc.gridx=1;
gbc.gridy++;
gbc.weightx=0.2;
basicsPanel.add(detailTriangle,gbc);
this.add(basicsPanel,BorderLayout.NORTH);
extraDataPanel.setVisible(detailTriangle.isDown());
this.add(extraDataPanel,BorderLayout.SOUTH);
TitledBorder tb=BorderFactory.createTitledBorder("Basic Data");
this.setBorder(tb);
}
| Initialize the basic info panel (generic synapse parameters) |
public boolean readSample(SampleHolder sampleHolder){
boolean haveSample=infoQueue.peekSample(sampleHolder,extrasHolder);
if (!haveSample) {
return false;
}
if (sampleHolder.isEncrypted()) {
readEncryptionData(sampleHolder,extrasHolder);
}
sampleHolder.ensureSpaceForWrite(sampleHolder.size);
readData(extrasHolder.offset,sampleHolder.data,sampleHolder.size);
long nextOffset=infoQueue.moveToNextSample();
dropDownstreamTo(nextOffset);
return true;
}
| Reads the current sample, advancing the read index to the next sample. |
public boolean createCSV(File file,char delimiter,Language language){
try {
Writer fw=new OutputStreamWriter(new FileOutputStream(file,false),Ini.getCharset());
return createCSV(new BufferedWriter(fw),delimiter,language);
}
catch ( FileNotFoundException fnfe) {
log.log(Level.SEVERE,"(f) - " + fnfe.toString());
}
catch ( Exception e) {
log.log(Level.SEVERE,"(f)",e);
}
return false;
}
| Create CSV File |
private void endDataSourceTag(){
buffer.append(" >\n");
}
| ends the data-source tag in progress. |
@RequestMapping(value="/activate/login/{login}",method=RequestMethod.GET) public @ResponseBody ModelAndView activationAccount(@PathVariable String login) throws ServiceException, CheckException {
logger.info("--ACTIVATION OF ACCOUNT--");
logger.debug("UserController : User " + login);
User user=userService.findByLogin(login);
userService.activationAccount(user);
logger.info("Activation successfull of account of " + login);
return new ModelAndView("redirect:/webui/#validated");
}
| Activate an User account |
public Device(DeviceManagerImpl deviceManager,Long deviceKey,Entity entity,IEntityClass entityClass){
this.deviceManager=deviceManager;
this.deviceKey=deviceKey;
this.entities=new Entity[]{entity};
this.macAddressString=entity.getMacAddress().toString();
this.entityClass=entityClass;
Arrays.sort(this.entities);
this.dhcpClientName=null;
this.oldAPs=null;
this.attachmentPoints=null;
if (entity.getSwitchDPID() != null && entity.getSwitchPort() != null) {
DatapathId sw=entity.getSwitchDPID();
OFPort port=entity.getSwitchPort();
if (deviceManager.isValidAttachmentPoint(sw,port)) {
AttachmentPoint ap;
ap=new AttachmentPoint(sw,port,entity.getLastSeenTimestamp());
this.attachmentPoints=new ArrayList<AttachmentPoint>();
this.attachmentPoints.add(ap);
}
}
vlanIds=computeVlandIds();
}
| Create a device from an entities |
public static void clearPreferences(final Context context){
final SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(context);
final SharedPreferences.Editor editor=preferences.edit();
editor.clear();
editor.commit();
}
| Clear all preferences. |
public boolean fileExists(){
return mId != -1;
}
| Can be used to check, whether or not this file exists in the database already |
public void cancelCatchingRequests(){
super.cancelCatchingRequests();
mIsBackPaginating=false;
mCanPaginateBack=true;
mRoom.cancelRemoteHistoryRequest();
mNextBatch=mRoom.getLiveState().getToken();
}
| Cancel the catching requests. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col, x, y;
double z;
float progress=0;
int a;
double sum;
int[] dX;
int[] dY;
double[] weights;
int numPixelsInFilter;
boolean absValuesOnly=false;
boolean reflectAtBorders=true;
String direction="vertical";
double centreValue;
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 == 1) {
outputHeader=args[i];
}
else if (i == 2) {
String str=args[i].toLowerCase();
if (str.contains("v")) {
direction="vertical";
}
else if (str.contains("h")) {
direction="horizontal";
}
else if (str.contains("45")) {
direction="45";
}
else if (str.contains("135")) {
direction="135";
}
else {
direction="vertical";
}
}
else if (i == 3) {
absValuesOnly=Boolean.parseBoolean(args[i]);
}
}
if ((inputHeader == null) || (outputHeader == null)) {
showFeedback("One or more of the input parameters have not been set properly.");
return;
}
try {
WhiteboxRaster inputFile=new WhiteboxRaster(inputHeader,"r");
inputFile.isReflectedAtEdges=reflectAtBorders;
int rows=inputFile.getNumberRows();
int cols=inputFile.getNumberColumns();
double noData=inputFile.getNoDataValue();
WhiteboxRaster outputFile=new WhiteboxRaster(outputHeader,"rw",inputHeader,WhiteboxRaster.DataType.FLOAT,noData);
outputFile.setPreferredPalette("grey.pal");
if (direction.equals("vertical")) {
weights=new double[]{-1,2,-1,-1,2,-1,-1,2,-1};
}
else if (direction.equals("horizontal")) {
weights=new double[]{-1,-1,-1,2,2,2,-1,-1,-1};
}
else if (direction.equals("135")) {
weights=new double[]{2,-1,-1,-1,2,-1,-1,-1,2};
}
else {
weights=new double[]{-1,-1,2,-1,2,-1,2,-1,-1};
}
dX=new int[]{-1,0,1,-1,0,1,-1,0,1};
dY=new int[]{-1,-1,-1,0,0,0,1,1,1};
numPixelsInFilter=dX.length;
if (absValuesOnly) {
for (row=0; row < rows; row++) {
for (col=0; col < cols; col++) {
centreValue=inputFile.getValue(row,col);
if (centreValue != noData) {
sum=0;
for (a=0; a < numPixelsInFilter; a++) {
x=col + dX[a];
y=row + dY[a];
z=inputFile.getValue(y,x);
if (z == noData) {
z=centreValue;
}
sum+=z * weights[a];
}
if (sum < 0) {
sum=-sum;
}
outputFile.setValue(row,col,sum);
}
else {
outputFile.setValue(row,col,noData);
}
}
if (cancelOp) {
cancelOperation();
return;
}
progress=(float)(100f * row / (rows - 1));
updateProgress((int)progress);
}
}
else {
for (row=0; row < rows; row++) {
for (col=0; col < cols; col++) {
centreValue=inputFile.getValue(row,col);
if (centreValue != noData) {
sum=0;
for (a=0; a < numPixelsInFilter; a++) {
x=col + dX[a];
y=row + dY[a];
z=inputFile.getValue(y,x);
if (z == noData) {
z=centreValue;
}
sum+=z * weights[a];
}
outputFile.setValue(row,col,sum);
}
else {
outputFile.setValue(row,col,noData);
}
}
if (cancelOp) {
cancelOperation();
return;
}
progress=(float)(100f * row / (rows - 1));
updateProgress((int)progress);
}
}
outputFile.addMetadataEntry("Created by the " + getDescriptiveName() + " tool.");
outputFile.addMetadataEntry("Created on " + new Date());
inputFile.close();
outputFile.close();
returnData(outputHeader);
}
catch ( OutOfMemoryError oe) {
myHost.showFeedback("An out-of-memory error has occurred during operation.");
}
catch ( Exception e) {
myHost.showFeedback("An error has occurred during operation. See log file for details.");
myHost.logException("Error in " + getDescriptiveName(),e);
}
finally {
updateProgress("Progress: ",0);
amIActive=false;
myHost.pluginComplete();
}
}
| Used to execute this plugin tool. |
public XOR128(long seed){
super(seed);
}
| Creates a new PRNG |
private List<StorageFileEntity> createStorageFileEntitiesFromStorageFiles(List<StorageFile> storageFiles,StorageEntity storageEntity,boolean storageFilesDiscovered,String expectedS3KeyPrefix,StorageUnitEntity storageUnitEntity,String directoryPath,boolean validatePathPrefix,boolean validateFileExistence,boolean validateFileSize,boolean isS3StoragePlatform){
List<StorageFileEntity> storageFileEntities=null;
if (!org.apache.commons.collections4.CollectionUtils.isEmpty(storageFiles)) {
storageFileEntities=new ArrayList<>();
storageUnitEntity.setStorageFiles(storageFileEntities);
S3FileTransferRequestParamsDto params=null;
Map<String,StorageFile> actualS3Keys=null;
if (validateFileExistence && isS3StoragePlatform && !storageFilesDiscovered) {
params=getFileValidationParams(storageEntity,expectedS3KeyPrefix,storageUnitEntity,validatePathPrefix);
actualS3Keys=storageFileHelper.getStorageFilesMapFromS3ObjectSummaries(s3Service.listDirectory(params,true));
}
if (validatePathPrefix && isS3StoragePlatform) {
String expectedS3KeyPrefixWithTrailingSlash=expectedS3KeyPrefix + "/";
Long registeredStorageFileCount=storageFileDao.getStorageFileCount(storageEntity.getName(),expectedS3KeyPrefixWithTrailingSlash);
if (registeredStorageFileCount > 0) {
throw new AlreadyExistsException(String.format("Found %d storage file(s) matching \"%s\" S3 key prefix in \"%s\" " + "storage that is registered with another business object data.",registeredStorageFileCount,expectedS3KeyPrefix,storageEntity.getName()));
}
}
for ( StorageFile storageFile : storageFiles) {
StorageFileEntity storageFileEntity=new StorageFileEntity();
storageFileEntities.add(storageFileEntity);
storageFileEntity.setStorageUnit(storageUnitEntity);
storageFileEntity.setPath(storageFile.getFilePath());
storageFileEntity.setFileSizeBytes(storageFile.getFileSizeBytes());
storageFileEntity.setRowCount(storageFile.getRowCount());
if (!storageFilesDiscovered) {
if (validatePathPrefix && isS3StoragePlatform) {
Assert.isTrue(storageFileEntity.getPath().startsWith(expectedS3KeyPrefix),String.format("Specified storage file path \"%s\" does not match the expected S3 key prefix \"%s\".",storageFileEntity.getPath(),expectedS3KeyPrefix));
}
else if (directoryPath != null) {
Assert.isTrue(storageFileEntity.getPath().startsWith(directoryPath),String.format("Storage file path \"%s\" does not match the storage directory path \"%s\".",storageFileEntity.getPath(),directoryPath));
}
if (validateFileExistence && isS3StoragePlatform) {
storageFileHelper.validateStorageFile(storageFile,params.getS3BucketName(),actualS3Keys,validateFileSize);
}
}
}
}
return storageFileEntities;
}
| Creates a list of storage file entities from a list of storage files. |
public static Serializer switchSerializerIfHTML(String ns,String localName,Properties props,Serializer oldSerializer) throws TransformerException {
Serializer newSerializer=oldSerializer;
if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) {
if (null != getOutputPropertyNoDefault(OutputKeys.METHOD,props)) return newSerializer;
Properties prevProperties=props;
OutputProperties htmlOutputProperties=new OutputProperties(Method.HTML);
htmlOutputProperties.copyFrom(prevProperties,true);
Properties htmlProperties=htmlOutputProperties.getProperties();
{
if (null != oldSerializer) {
Serializer serializer=SerializerFactory.getSerializer(htmlProperties);
Writer writer=oldSerializer.getWriter();
if (null != writer) serializer.setWriter(writer);
else {
OutputStream os=serializer.getOutputStream();
if (null != os) serializer.setOutputStream(os);
}
newSerializer=serializer;
}
}
}
return newSerializer;
}
| Switch to HTML serializer if element is HTML |
private static void validateTextField(CatalogServiceRestRep catalogService,ServiceFieldRestRep field,String fieldName,String value){
if (StringUtils.isNotBlank(value)) {
validateRegex(fieldName,value,field.getRegEx(),field.getFailureMessage());
validateLength(fieldName,value,field.getMin(),field.getMax());
}
}
| Validates a text field. |
public List<User> queryDeep(String where,String... selectionArg){
Cursor cursor=db.rawQuery(getSelectDeep() + where,selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
| A raw-style query where you can pass any WHERE clause and arguments. |
public SortOrder(){
}
| This class is never instantiated |
void requireBinding(String prefix,String ns){
noteBinding(prefix,ns,true);
}
| prefix may be empty string |
public boolean isDebug(){
return _isDebug;
}
| Gets the debug |
protected void drawPoint(FloatPoint point,Canvas canvas,Paint paint){
canvas.drawPoint(point.x,point.y,paint);
}
| Draw a point in canvas |
@Override public String toString(){
return String.valueOf(value);
}
| Gets the String representation of this in/out parameter value. <p/> |
public static Ordering asc(String propertyName){
return new Ordering(propertyName,Order.ASCENDING,NullOrdering.FIRST);
}
| Create an ordering to order results by the given property in ascending order with nulls first |
public void removeAlias(Origin alias){
aliases.remove(alias);
}
| Removes an alias to another origin. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.