Java 8 AttributeList - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AttributeList class.

This code example shows how to use the following methods:getValue
		return retVal;
	} 
 
	private StructVector parseVector(AttributeList attrs) {
		StructVector vector = new StructVector();
		vector.mId = parseInt(attrs.getValue("id"));
		vector.mInterpolationType = parseInterpolationType(attrs);
		vector.mTimeStart = parseFloat(attrs.getValue("t0"));
		vector.mTimeEnd = parseFloat(attrs.getValue("t1"));
		vector.mCtrl0 = parseFloatArray(attrs.getValue("c0"));
		vector.mCtrl1 = parseFloatArray(attrs.getValue("c1"));
		vector.mCtrl2 = parseFloatArray(attrs.getValue("c2"));
		return vector;
	} 
 
	public static class Data { 
		public final float[] mCameraLookAt = new float[3];
		public final float[] mCameraPosition = new float[3];
		public final float[] mForegroundColor = new float[4];
		public final float[] mLightPosition = new float[3];
6
CodeRank
This code example shows how to use the following methods:getValue
		this.running = false;
	} 
	 
	 
	private void processRefinementTag(AttributeList attributes) {		
		final String refinementId = attributes.getValue("id");
		final String displayName = attributes.getValue("display-name");
		final String refinedUrl = attributes.getValue("refined-url");
		 
		int refinementCount = 0;
		final String refinementCountString = attributes.getValue("count");
		try { 
			refinementCount = Integer.parseInt(refinementCountString);
		} catch (NumberFormatException e) {
			Log.i(TAG, "NumberFormatException while parsing refinement count: " + refinementCount);
		} 
		 
		Log.d(TAG, "Adding refinement: type='" + currentRefinementGroupType + "', id='" + refinementId + "'");	
		getRefinementGroup().add(new Refinement(currentRefinementGroupType, refinementId, displayName, refinedUrl, refinementCount));		
	} 
5
CodeRank
This code example shows how to use the following methods:getValue
			} catch (IllegalArgumentException ignore) { }
		} 
		 
		private void handleStrTag(AttributeList attributes) {
			try { 
				StrTag strTag = StrTag.valueOf(attributes.getValue(NAME_ATTRIBUTE));
				 
				// TODO 
			} catch (IllegalArgumentException ignore) {
			} catch (NullPointerException ignore) {}
			 
		} 
 
		@Override 
		public void characters(char[] ch, int start, int length)
				throws SAXException { 
			super.characters(ch, start, length);
			tempVal = new String(ch, start, length);
		} 
 
4
CodeRank
This code example shows how to use the following methods:getLength
    private void prepareReusableAttributes(AttributeList atts) {
        if (_reusableAtts == null) {
            if (atts == null) {
                _reusableAtts = new AttributeSetImpl();
            } else { 
                _reusableAtts = new AttributeSetImpl(atts.getLength());
            } 
        } else { 
            _reusableAtts.clear();
        } 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:getLength
        } // startDocument() 
 
        /** Start element. */ 
        public void startElement(String name, AttributeList attrs) { 
            fElementCount++; 
            fAttributeCount += attrs != null ? attrs.getLength() : 0; 
        } // startElement(String,AttributeList) 
 
        /** Ignorable whitespace. */ 
        public void ignorableWhitespace(char[] ch, int offset, int length) { 
            fIgnorableWhitespaceCount += length; 
        } // ignorableWhitespace(char[],int,int) 
 
        /** Characters. */ 
        public void characters(char[] ch, int offset, int length) { 
            fCharactersCount += length; 
        } // characters(char[],int,int) 
 
        /** End document. */ 
        public void endDocument() { 
3
CodeRank
This code example shows how to use the following methods:getValue
     * it to be executed at parse time. 
     * 
     * @see #configure(Object,AttributeList,Project) 
     */ 
    private void configureId(Object target, AttributeList attr) {
        String id = attr.getValue("id");
        if (id != null) {
            project.addReference(id, target);
        } 
    } 
} 
3
CodeRank
This code example shows how to use the following methods:getValue
			super.endDocument(); 
		} 
		 
		@Override 
		public void startElement(String localName, AttributeList atts) throws SAXException {
			System.out.println("e621api: xml parser tag found ID " + atts.getValue("id"));
			super.startElement(localName, atts);
			post = new postObject();
			 
			try { 
				try {post.setFile_size(Integer.valueOf(atts.getValue("file_size")));}catch(NumberFormatException e){post.setFile_size(0);}
				try {post.setId(Integer.valueOf(atts.getValue("id")));}catch(NumberFormatException e){post.setId(0);}
				try {post.setParent_id(Integer.valueOf(atts.getValue("parent_id")));}catch(NumberFormatException e){post.setParent_id(0);}
				try {post.setCreator_id(Integer.valueOf(atts.getValue("creator_id")));}catch(NumberFormatException e){post.setCreator_id(0);}
				try {post.setHeight(Integer.valueOf(atts.getValue("height")));}catch(NumberFormatException e){post.setHeight(0);}
				try {post.setWidth(Integer.valueOf(atts.getValue("width")));}catch(NumberFormatException e){post.setWidth(0);}
				try {post.setSample_height(Integer.valueOf(atts.getValue("sample_height")));}catch(NumberFormatException e){post.setSample_height(0);}
				try {post.setSample_width(Integer.valueOf(atts.getValue("sample_width")));}catch(NumberFormatException e){post.setSample_width(0);}
				try {post.setPreview_height(Integer.valueOf(atts.getValue("preview_height")));}catch(NumberFormatException e){post.setPreview_height(0);}
				try {post.setPreview_width(Integer.valueOf(atts.getValue("preview_width")));}catch(NumberFormatException e){post.setPreview_width(0);}

-4
CodeRank
See Code Examples for Java 8 AttributeList Methods: